Ethereum Asked by Sowmay Jain on December 25, 2021
I’m trying to convert a hashed block number “30054a” into readable format but I’m getting logs something like this:
0J
For another hashed value:
Y����#�(�J�d��F,ĦJ/
I’m using the following code on my NodeJS server:
const util = require(‘ethjs-util’);
const value = util.toAscii(‘30054a’);
console.log(value);
I had even tried toUtf8
. I’m using ethjs library.
Where am I wrong?
You said the value is "hashed," but I think you're just looking at the hexadecimal number?
If so, parseInt('30054a', '16') == 3147082
. 3147082 is the decimal representation of the hexadecimal number 0x30054a.
If you actually have a value that's been hashed, there's generally no way to reverse that process. (A cryptographic hash function is designed to be one-way.)
Answered by user19510 on December 25, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP