Skip to content

hashMessage

hashMessage(message): string

Defined in: utils/hash-message.ts:20

Computes the EIP-191 personal message digest of message. Personal messages are converted to UTF-8 bytes and prefixed with \x19Ethereum Signed Message: and the length of message.

Parameters

message

the message to hash

string | Bytes

Returns

string

a message hashed using Keccak256 that matches the EIP-191 standard

Example

hashMessage("Hello World");
// '0xa1de988600a42c4b4ab089b619297c17d53cffae5d5120d82d8a92d0bb3b78f2'