File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ test('Test BitTorrent v2 hash support', async t => {
2323 parsed = await parseTorrent ( magnetV2 )
2424 t . equal ( parsed . infoHashV2 , v2Hash . toLowerCase ( ) , 'magnet v2 hash should match' )
2525
26+ // hybrid magnet uri (both btih and btmh)
27+ const hybridMagnet = 'magnet:?xt=urn:btih:631a31dd0a46257d5078c0dee4e66e26f73e42ac&xt=urn:btmh:1220d8dd32ac93357c368556af3ac1d95c9d76bd0dff6fa9833ecdac3d53134efabb'
28+ parsed = await parseTorrent ( hybridMagnet )
29+ t . equal ( parsed . infoHash , '631a31dd0a46257d5078c0dee4e66e26f73e42ac' , 'hybrid magnet should have v1 infoHash' )
30+ t . equal ( parsed . infoHashV2 , 'd8dd32ac93357c368556af3ac1d95c9d76bd0dff6fa9833ecdac3d53134efabb' , 'hybrid magnet should have v2 infoHash' )
31+
2632 // parsed torrent with both v1 and v2 hashes (hybrid)
2733 const torrentObjHybrid = {
2834 infoHash : 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36' ,
You can’t perform that action at this time.
0 commit comments