Skip to content

Commit

Permalink
fix: base32 in browser (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaUnknown committed May 27, 2023
1 parent 1e08fca commit 287c063
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function magnetURIDecode (uri) {
result.infoHash = m[1].toLowerCase()
} else if ((m = xt.match(/^urn:btih:(.{32})/))) {
const decodedStr = base32.decode(m[1])
result.infoHash = bin2hex(decodedStr)
result.infoHash = bin2hex(decodedStr.toString('binary'))
} else if ((m = xt.match(/^urn:btmh:1220(.{64})/))) {
result.infoHashV2 = m[1].toLowerCase()
}
Expand Down

0 comments on commit 287c063

Please sign in to comment.