TransWikia.com

How to convert hashed result into readable format?

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?

One Answer

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

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP