bnToU8a supports endian (#87)
* bnToU8a supports endian * Update with new bn.js flow
This commit is contained in:
@@ -61,11 +61,11 @@ bnToHex(new BN(0x123456)); // => '0x123456'
|
||||
Creates a Uint8Array object from a BN.
|
||||
|
||||
```js
|
||||
bnToU8a (value?: BN | number, bitLength: number = -1): Uint8Array
|
||||
bnToU8a (value?: BN | number, bitLength: number = -1, isLE: boolean = false): Uint8Array
|
||||
```
|
||||
|
||||
|
||||
`null`/`undefined`/`NaN` inputs returns an empty `Uint8Array` result. `BN` input values return the actual bytes value converted to a `Uint8Array`.
|
||||
`null`/`undefined`/`NaN` inputs returns an empty `Uint8Array` result. `BN` input values return the actual bytes value converted to a `Uint8Array`. Optionally convert using little-endian format if `isLE` is set.
|
||||
|
||||
```js
|
||||
import { bnToU8a } from '@polkadot/util';
|
||||
|
||||
Reference in New Issue
Block a user