Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In solidity, keccak 256 function returns a hash value. How many bits does keccak 256 return?

I used the following command : keccak256('abc', 'pqr', 123); I get a value once I run this. How many bit value is this?

like image 308
Rahul Sharma Avatar asked Nov 21 '16 07:11

Rahul Sharma


People also ask

What is Keccak solidity?

Keccak256 is a cryptographic function built into solidity. This function takes in any amount of inputs and converts it to a unique 32 byte hash. The sample contract below takes a text value, a number and an Ethereum address and converts it to a unique 32 byte hash using Keccak256.

Is Keccak-256 reversible?

Keccak-256, a cryptographic function, is part of Solidity (SHA-3 Family). This function computes the hash of an input to a fixed-length output, yielding a singular 32-byte hash from any number of inputs. This cryptographic hash function can only be used in one direction and cannot be reversed.

What is hash in solidity?

A cryptographic hash function is an algorithm that takes an arbitrary amount of data as input and produces the enciphered text of fixed size. Even a slight change in the input gives a completely different output. Solidity provides the following cryptographic functions: Function. Properties.

How do you decode Keccak256 in solidity?

The keccak256 (SHA-3 family) algorithm computes the hash of an input to a fixed length output. The input can be a variable length string or number, but the result will always be a fixed bytes32 data type. It is a one-way cryptographic hash function, which cannot be decoded in reverse.


1 Answers

Keccak-256 in Solidity returns a 32 byte array (which could also be represented as a 256 bit string), as described in the Solidity Documentation.

like image 117
bekah Avatar answered Sep 28 '22 13:09

bekah