Od pewnego czasu próbuję stworzyć generatora magnet linków. Tak jak tutaj: http://centrump2p.com/magnet/
Przykładowo posiadam taki info_hash:
8905762b8851be015260b72d92b34cf55bcdb254 // 40 znaków
Po generatorze centrump2p.com wygląda on tak:
RECXMK4IKG7ACUTAW4WZFM2M6VN43MSU // 32 znaki
Dokumentacje:
vuze.com ( http://wiki.vuze.com/w/Magnet_link ):
The magnet link consists of the prefix magnet:?xt=urn:btih: and the base32() encoded SHA1 of the torrent's info dictionary (known as torrent-hash or infohash). Please note that's the base32-encoding of the torrent-hash's binary (20byte) representation, not the hexadecimal representation.
bittorrent.org ( http://bittorrent.org/beps/bep_0009.html ):
Is the info-hash hex encoded, for a total of 40 characters. For compatability with existing links in the wild, clients should also support the 32 character base32 [1] encoded info-hash.
Próbuję w ten sposób
magnet.php
<?php include('class.base32.php5'); $info_hash = '8905762b8851be015260b72d92b34cf55bcdb254'; $b = new Base32(Base32::csRFC3548); ?>
Klasa base32 znajduję się tutaj: http://fremnet.net/article/215/class-base32
No i niestety wygląda to tak, że otrzymuję 64 znakowy ciąg (powinien być 32):
HA4TANJXGYZGEOBYGUYWEZJQGE2TENRQMI3TEZBZGJRDGNDDMY2TKYTDMRRDENJU
Bardzo proszę o pomoc przy tym kodowaniu,
Pozdrawiam.