Skip to content

stripZeros

stripZeros(value): Uint8Array

Defined in: utils/bytes.ts:293

Strips leading zeros from a BytesLike object

Parameters

value

BytesLike

the value to strip leading zeros from

Returns

Uint8Array

value without leading zeroes, expressed as a Uint8Array

Example

stripZeros('0x00002834');
// Uint8Array { [Iterator] 0: 40, 1: 52 }
// Equivalent to '0x2834'