Utility module: near

near-runtime-ts > "near" > near

Module: near

Index

Functions

  • base58

  • hash

  • hash32

  • log

  • random32

  • randomBuffer

  • str

Functions

base58

base58(source: Uint8Array): string

Defined in near.ts:846

Parameters:

Name

Type

source

Uint8Array

Returns: string

hash

hash<T>(data: T): Uint8Array

Defined in near.ts:796

Hash given data. Returns hash as 32-byte array.

Type parameters:

T

Parameters:

Name

Type

Description

data

T

data can be passed as either Uint8Array or anything with .toString (hashed as UTF-8 string).

Returns: Uint8Array

hash32

hash32<T>(data: T): u32

Defined in near.ts:811

Hash given data. Returns hash as 32-bit integer.

Type parameters:

T

Parameters:

Name

Type

Description

data

T

data can be passed as either Uint8Array or anything with .toString (hashed as UTF-8 string).

Returns: u32

log

log(msg: string): void

Defined in near.ts:837

Parameters:

Name

Type

msg

string

Returns: void

random32

random32(): u32

Defined in near.ts:833

Returns random 32-bit integer.

Returns: u32

randomBuffer

randomBuffer(len: u32): Uint8Array

Defined in near.ts:824

Returns random byte buffer of given length.

Parameters:

Name

Type

len

u32

Returns: Uint8Array

str

str<T>(value: T): string

Defined in near.ts:841

Type parameters:

T

Parameters:

Name

Type

value

T

Returns: string