UNPKG

915 BTypeScriptView Raw
1/// <reference types="bn.js" />
2import type { ToBnOptions } from '../types';
3import { BN } from '../bn/bn';
4/**
5 * @name u8aToBn
6 * @summary Creates a BN from a Uint8Array object.
7 * @description
8 * `UInt8Array` input values return the actual BN. `null` or `undefined` values returns an `0x0` value.
9 * @param value The value to convert
10 * @param options Options to pass while converting
11 * @param options.isLe Convert using Little Endian (default)
12 * @param options.isNegative Convert using two's complement
13 * @example
14 * <BR>
15 *
16 * ```javascript
17 * import { u8aToBn } from '@polkadot/util';
18 *
19 * u8aToHex(new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0xf])); // 0x68656c0f
20 * ```
21 */
22declare function u8aToBn(value: Uint8Array, options?: ToBnOptions): BN;
23/** @deprecated Use u8aToBn(value: Uint8Array, options?: ToBnOptions) */
24declare function u8aToBn(value: Uint8Array, options?: boolean): BN;
25export { u8aToBn };