Skip to content

decodeBytes32String

decodeBytes32String(bytes32): string

Defined in: utils/bytes32-string.ts:41

Decode a bytes32 hex value into a string, stripping trailing null bytes.

Similar to “decodeBytes32String” in ethers.js v6

Parameters

bytes32

string

the bytes32 hex string to decode

Returns

string

the decoded string

Example

decodeBytes32String('0x657373656e7469616c2d657468000000000000000000000000000000000000')
// 'essential-eth'