Last updated
Last updated
There are many hashing algorithms used throughout the hashgraph and blockchain space as well as some more complex usages which require utilities to facilitate these common operations.
The Hashing Utilities are directly imported from . The complete documentation can be found in the official .
The are a specific family of hash functions.
hethers.utils.id( text ) ⇒ string<DataHexString<32>>
The Ethereum Identity function computes the hash of the text bytes.
hethers.utils.keccak256( aBytesLike ) ⇒ string<
<32>>
Returns the digest aBytesLike.
hethers.utils.ripemd160( aBytesLike ) ⇒ string<
<20>>
Returns the digest of aBytesLike.
hethers.utils.sha256( aBytesLike ) ⇒ string<
<32>>
Returns the digest of aBytesLike.
hethers.utils.sha512( aBytesLike ) ⇒ string<
<64>>
Returns the digest of aBytesLike.
hethers.utils.SupportedAlgorithm.sha256 ⇒ string
hethers.utils.SupportedAlgorithm.sha512 ⇒ string
namehash
and isValidName
are removed from hethers.utils
Signed data requires a domain, list of structures and their members and the data itself.
The domain is an object with values for any of the standard domain properties.
The types is an object with each property being the name of a structure, mapping to an array of field descriptions. It should not include the EIP712Domain
property unless it is required as a child structure of another
hethers.utils._TypedDataEncoder.from( types ) ⇒ [TypedDataEncoder]
Creates a new TypedDataEncoder for types. This object is a fairly low-level object that most developers should not require using instances directly.
Most developers will find the static class methods below the most useful.
TypedDataEncoder.encode( domain , types , values ) ⇒ string
TypedDataEncoder.getPayload( domain , types , value ) ⇒ any
Returns the standard payload used by various JSON-RPC eth_signTypedData*
calls.
All domain values and entries in value are normalized and the types are verified.
TypedDataEncoder.getPrimaryType( types ) ⇒ string
TypedDataEncoder.resolveNames( domain , types , value , resolveName ) ⇒ Promise<any>
Returns a copy of value, where any leaf value with a type of address
will have been recursively replaced with the value of calling resolveName with that value.
When using the Solidity abi.packEncoded(...)
function, a non-standard tightly packed version of encoding is used. These functions implement the tightly packing algorithm.
Returns the non-standard encoded values packed according to their respective type in types.
Returns the of data with key using one of the the .
Use the hash algorithm.
Use the hash algorithm.
Computes the personal message digest of message. Personal messages are converted to UTF-8 bytes and prefixed with \x19Ethereum Signed Message:
and the length of message.
The TypedDataEncoder is used to compute the various encoded data required for signed data.
Encodes the Returns the hashed domain.
Constructs a directed acyclic graph of the types and returns the root type, which can be used as the primaryType for payloads.
Returns the computed hash.
Returns the hashed domain.
Returns the of the non-standard encoded values packed according to their respective type in types.
Returns the of the non-standard encoded values packed according to their respective type in types.