hashMessage static method

String hashMessage(
  1. dynamic message
)

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.


// Hashing a string message
EthUtils.hashMessage("Hello World")
// '0xa1de988600a42c4b4ab089b619297c17d53cffae5d5120d82d8a92d0bb3b78f2'

// Hashing binary data (also "Hello World", but as bytes)
utils.hashMessage( [ 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100 ])
// '0xa1de988600a42c4b4ab089b619297c17d53cffae5d5120d82d8a92d0bb3b78f2'

Implementation

external static String hashMessage(dynamic message);