If found a lot of similar questions, but they were all about python or other programming languages that I don't really understand.
My question is really simple: How do I convert a .torrent file into a magnet link/URI? Assuming that functions like Base32Encode() or GetSha1Hash() already exist in the program. It doesn't really have to be in javascript, something like "You have to base32 encode the first 80 bytes of the file, multiply it by 5 and create an sha-1 hash form it would be enough.
The simplest magnet URI is just the hex-encoded info hash of the torrent:
To compute the info hash of a torrent, you need to SHA1-sum the
info
dict of the torrent file as a string.