Post
Topic
Board Development & Technical Discussion
Re: Bitcoin script. Need help.
by
kzv
on 13/10/2018, 07:12:08 UTC
I receive the same result, when I provide the plain string to openssl;

Code:
printf c47907abd2a80492ca9388b05c0e382518ff3960 | openssl dgst -ripemd160
(stdin)= 388756dc41f4eeadcb3fc5064535d1121a49d3f4

what I try to say is perhaps better described here (it is on sha256, but also applies to ripemd160):

https://bitcoin.stackexchange.com/questions/43347/how-to-generate-bitcoin-address


Thank you!
I had to found the correct way for hashing in node.js

Code:
function Hash(str)
{
    const buffer = str.length % 2 != 0 ? Buffer.from(str) : Buffer.from(str, "hex");
    return require('crypto').createHash("ripemd160").update(buffer).digest('hex')
}