Skip to main content

Bytes

o1js / Modules / Bytes

Namespace: Bytes

Table of contents

Variables

Variables

from

from: (data: Uint8Array | Bytes | (number | bigint | UInt8)[]) => Bytes

Type declaration

▸ (data): Bytes

Coerce the input to Bytes.

Inputs smaller than this.size are padded with zero bytes.

Parameters
NameType
dataUint8Array | Bytes | (number | bigint | UInt8)[]
Returns

Bytes

Defined in

lib/provable-types/provable-types.ts:19


fromHex

fromHex: (xs: string) => Bytes

Type declaration

▸ (xs): Bytes

Create Bytes from a hex string.

Inputs smaller than this.size are padded with zero bytes.

Parameters
NameType
xsstring
Returns

Bytes

Defined in

lib/provable-types/provable-types.ts:20


fromString

fromString: (s: string) => Bytes

Type declaration

▸ (s): Bytes

Create Bytes from a string.

Inputs smaller than this.size are padded with zero bytes.

Parameters
NameType
sstring
Returns

Bytes

Defined in

lib/provable-types/provable-types.ts:21