Closed dckc closed 5 years ago
I just looked at sha3 in web3. It's got a crazy-nutso exception for strings starting with 0x
:
web3.utils.sha3('234'); // taken as string
> "0xc1912fee45d61c87cc5ea59dae311904cd86b84fee17cc96966216f811ce6a79"
...
web3.utils.sha3('0xea'); // will be converted to a byte array first, and then hashed
> "0x2f20677459120677484f7104c76deb6846a2c071f9b3152c103bb12cd54d1a4a"
So I guess if you want to hash the string 0xdeadbeef
you have to use 0x30786465616462656566
???
We have address this, to my satisfaction, in e95c909ce636512e0cd74af043d3e9e6381cdd43 and related commits.
Anybody who isn't satisfied, please open an issue in https://github.com/rchain-community/rchain-api/issues
@JoshOrndorff made a comment asking that we consider this developer story: