Skip to content

password

password(pwd): Hash32

Defined in: src/Hash.ts:141

Compute the persistent hash of a password string.

Convenience function that converts the string to bytes32 and hashes it. Equivalent to bytes32(stringToBytes32(password)).

Parameters

pwd

string

Returns

Hash32

The hash as a 32-byte Uint8Array

Example

const passwordHash = Midday.Hash.password('my-secret-password');
// Use as initial ledger value in contract init
await contract.actions.init(passwordHash);

Since

0.3.0