hashMessage

Ethereum Signed Message hashing

Example

import { hashMessage } from "thirdweb/utils";
const hash = hashMessage("hello world");
function hashMessage(
message: SignableMessage,
to_?: TTo,
): HashMessage<TTo>;

Parameters

The message to hash, either as a string, a Uint8Array, or an object with a raw property containing a Uint8Array.

Type

let message: SignableMessage;

The desired output format of the hash (optional). Defaults to 'hex'.

Type

let to_: TTo;

Returns

let returnType: HashMessage<TTo>;

The Ethereum Signed Message hash of the message in the specified format.