Is it possible somehow to get a uint256 hash from solidity array types such a strings or bytes32[]?
I want to create mapping (uint256 => address) where uint256 is a hash of some string what user entered earlier. Thanx!
You can use keccak256()
on any Solidity type (including strings and arrays) to generate a bytes32
hash. From there, you can either just use the bytes32
result as your key or cast it to a uint
.