Skip to main content

Encoding

SnarkyJS / Modules / Encoding

Namespace: Encoding

Table of contents

Variables

Functions

Variables

Bijective

Const Bijective: Object

Type declaration

NameType
Fp{ fromBytes: (bytes: Uint8Array) => Field[] ; toBytes: (fields: Field[]) => Uint8Array ; fromString: (message: string) => Field[] ; toString: (fields: Field[]) => string }
Fp.fromBytes(bytes: Uint8Array) => Field[]
Fp.toBytes(fields: Field[]) => Uint8Array
Fp.fromString[object Object]
Fp.toString[object Object]
Fq{ fromBytes: (bytes: Uint8Array) => Field[] ; toBytes: (fields: Field[]) => Uint8Array ; fromString: (message: string) => Field[] ; toString: (fields: Field[]) => string }
Fq.fromBytes(bytes: Uint8Array) => Field[]
Fq.toBytes(fields: Field[]) => Uint8Array
Fq.fromString[object Object]
Fq.toString[object Object]

Defined in

bindings/lib/encoding.ts:98

Functions

bytesFromFields

bytesFromFields(fields): Uint8Array

Decodes a list of Field elements into a Uint8Array.

Parameters

NameType
fieldsField[]

Returns

Uint8Array

Defined in

bindings/lib/encoding.ts:67


bytesToFields

bytesToFields(bytes): Field[]

Encodes a Uint8Array into Field elements.

Parameters

NameType
bytesUint8Array

Returns

Field[]

Defined in

bindings/lib/encoding.ts:45


stringFromFields

stringFromFields(fields): string

Decodes a list of Field elements into a JavaScript string.

This function is not a valid in-snark computation.

Parameters

NameType
fieldsField[]

Returns

string

Defined in

bindings/lib/encoding.ts:35


stringToFields

stringToFields(message): Field[]

Encodes a JavaScript string into a list of Field elements.

This function is not a valid in-snark computation.

Parameters

NameType
messagestring

Returns

Field[]

Defined in

bindings/lib/encoding.ts:25