computation is much more complex and usually done by specialised libraries or tools. however, I have added some lines for manual method. hope, this will give some insight.
writes about blockchain solution development | LinkedIn: https://www.linkedin.com/in/ac12644 | Github: https://github.com/ac12644