Files
common/docs/util/modules/_u8a_tobn_.md
T
2018-12-21 09:08:40 +00:00

1.1 KiB

Functions

u8aToBn

▸ u8aToBn(value: Uint8Array, options?: * ToBnOptions | boolean*): BN

Defined in u8a/toBn.ts:30

name: u8aToBn

signature: u8aToHex (value?: Uint8Array, options: ToBnOptions | boolean = { isLe: true, isNegative: false }): BN

summary: Creates a BN from a Uint8Array object.

description: UInt8Array input values return the actual BN. null or undefined values returns an 0x0 value.

example:

import { u8aToBn } from '@polkadot/util';

u8aToHex(new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0xf])); // 0x68656c0f

Parameters:

Name Type Default value Description
value Uint8Array - The value to convert
Default value options ToBnOptions | boolean { isLe: true, isNegative: false } Options to pass while converting

Returns: BN