I am building up a project based on p2p networking. And I am not able to find any algorithm to calculate hash info for a torrent file. Can someone please help with the this?
How to calculate hash info for a torrent file in java?
536 Views Asked by Purvil Bambharolia At
2
There are 2 best solutions below
0

There are many algorithms to find hash. Among them MD5 and SHA1 are popular algorithms.
In the above post, he mentioned the usage of MD5 Hasing. To do the SHA1 hasing, please use this post.
You can use java.security.MessageDigest. Check the below program which calculates MD5Sum/hash bytes and converts it to Hex String format.