.. | ||
index.html | ||
README.md |
Hashing Algorithms
Explain what hash functions are?
Cryptographic Hashing
The Cryptographic Hash Functions are a specific family of hash functions.
ethers . utils . keccak256 ( aBytesLike ) => string< DataHexstring< 32 > >
Returns the KECCAK256 digest aBytesLike.
ethers . utils . ripemd160 ( aBytesLike ) => string< DataHexstring< 20 > >
Returns the RIPEMD-160 digest of aBytesLike.
ethers . utils . sha256 ( aBytesLike ) => string< DataHexstring< 32 > >
Returns the SHA2-256 digest of aBytesLike.
ethers . utils . sha512 ( aBytesLike ) => string< DataHexstring< 64 > >
Returns the SHA2-512 digest of aBytesLike.
ethers . utils . computeHmac ( algorithm , key , data ) => string< DataHexstring >
Returns the HMAC of data with key using the Algorithm algorithm.
HMAC Supported Algorithms
ethers . utils . SupportedAlgorithm . sha256 => string
Use the SHA2-256 hash algorithm.
ethers . utils . SupportedAlgorithm . sha512 => string
Use the SHA2-512 hash algorithm.
Common Hashing Helpers
ethers . utils . hashMessage ( message ) => string< DataHexstring< 32 > >
Computes the Ethereum message digest of message. Ethereum messages are
converted to UTF-8 bytes and prefixed with \x19Ethereum Signed Message:
and the length of message.
ethers . utils . id ( text ) => string< DataHexstring< 32 > >
The Ethereum Identity function computs the keccak256 hash of the text bytes.
ethers . utils . namehash ( name ) => string< DataHexstring< 32 > >
Returns the ENS Namehash of name.
Solidity Hashing Algorithms
When using the Solidity abi.packEncoded(...)
function, a non-standard
tightly packed version of encoding is used. These functions implement
the tightly packing algorithm.
ethers . utils . solidityPack ( arrayOfTypes , arrayOfValues ) => string< DataHexstring >
Returns the non-standard encoded arrayOfValues packed according to their respecive type in arrayOfTypes.
ethers . utils . solidityKeccak256 ( arrayOfTypes , arrayOfValues ) => string< DataHexstring< 32 > >
Returns the KECCAK256 of the non-standard encoded arrayOfValues packed according to their respective type in arrayOfTypes.
ethers . utils . soliditySha256 ( arrayOfTypes , arrayOfValues ) => string< DataHexstring< 32 > >
Returns the SHA2-256 of the non-standard encoded arrayOfValues packed according to their respective type in arrayOfTypes.
Content Hash: 45555de5a99896ceb416df9f1c5da990ab6d1decc0ecbfba38eea5a476772fba