mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-28 16:47:58 +00:00
22 lines
747 B
TypeScript
22 lines
747 B
TypeScript
import type { ToBnOptions } from '../types.js';
|
|
import { BN } from '../bn/bn.js';
|
|
/**
|
|
* @name u8aToBn
|
|
* @summary Creates a BN from a Uint8Array object.
|
|
* @description
|
|
* `UInt8Array` input values return the actual BN. `null` or `undefined` values returns an `0x0` value.
|
|
* @param value The value to convert
|
|
* @param options Options to pass while converting
|
|
* @param options.isLe Convert using Little Endian (default)
|
|
* @param options.isNegative Convert using two's complement
|
|
* @example
|
|
* <BR>
|
|
*
|
|
* ```javascript
|
|
* import { u8aToBn } from '@pezkuwi/util';
|
|
*
|
|
* u8aToHex(new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0xf])); // 0x68656c0f
|
|
* ```
|
|
*/
|
|
export declare function u8aToBn(value: Uint8Array, { isLe, isNegative }?: ToBnOptions): BN;
|