user19134890
user19134890

Reputation:

How to hash two bytes32 vars via keccak256 in the most gas-efficient way using Solidity keys

I know how to get hash by using keccak256() function and here is the sample answer. bytes32 c = keccak256(abi.encodePacked(a, b)); But is this the only way and best way???

Upvotes: 1

Views: 394

Answers (1)

Mikko Ohtamaa
Mikko Ohtamaa

Reputation: 83686

But is this the only way and best way???

Yes, unless you want to cause some pain for yourself.

Upvotes: 1

Related Questions