base58 encode/decode in javascript as a substitute of Python

0
55


import base58

x = 'xprv9zMNTdwnPhmujEi9b579pSGnaRup2V3zNxbbeeqYfJJ8SJ8otgC5KyBEnFvNtV42ZC1r39HnohFwziYj5AvRHknYvyey77udHzToGc6wSoy'
zp = b'x04xb2x43x0c'
print(base58.b58encode_check(zp + base58.b58decode_check(x)[4:]).decode('ascii'))
#zprvAe1u4yHch4rsRq6PFngQEcTnvNChuj2zDBe3DSdKRK3tYVmGPzXCa6VWpfqYtJMsNUFTY6Uuj1y3mHmrWZkStE9kff3pGwYbqSb63iWdbYi

This code merely ‘converts’ an xprv right into a zprv – it really works precisely how I would like it to, the zprv is my desired output.

Does anybody know the way I can acheive comparable performance utilizing javascript?



Supply hyperlink

Leave a reply