Open TABmk opened 3 years ago
https://github.com/guyht/notp/blob/bbdf82a34e5cb1534c411aaa63185bfab29feba0/index.js#L10-L19
intToBytes(9999999999999) will give [0, 0, 0, 0, 78, 114, 159, 255] which is <Buffer 00 00 00 00 4e 72 9f ff>
intToBytes(9999999999999)
[0, 0, 0, 0, 78, 114, 159, 255]
<Buffer 00 00 00 00 4e 72 9f ff>
But 9999999999999 decimal to hexadecimal must return 00 00 09 18 4E 72 9F FF
9999999999999
00 00 09 18 4E 72 9F FF
Well... [...Buffer.from("0" + BigInt(9999999999999).toString(16), "hex")]
[...Buffer.from("0" + BigInt(9999999999999).toString(16), "hex")]
ugly hack, bug whatever...
https://github.com/guyht/notp/blob/bbdf82a34e5cb1534c411aaa63185bfab29feba0/index.js#L10-L19
intToBytes(9999999999999)
will give[0, 0, 0, 0, 78, 114, 159, 255]
which is<Buffer 00 00 00 00 4e 72 9f ff>
But
9999999999999
decimal to hexadecimal must return00 00 09 18 4E 72 9F FF