name: UInt
description: A generic unsigned integer codec. For Substrate all numbers are LE encoded, this handles the encoding and decoding of those numbers. Upon construction the bitLength is provided and any additional use keeps the number to this length. This extends BN, so all methods available on a normal BN object is available here.
Hierarchy
AbstractInt
↳ UInt
↳ U32
↳ U64
↳ U128
↳ U16
↳ U8
↳ U256
Implements
Constructors
constructor
⊕ new UInt(value?: AnyNumber, bitLength?: UIntBitLength, isHexJson?: boolean): UInt
Overrides AbstractInt.__constructor
Defined in codec/UInt.ts:21
Parameters:
| Name | Type | Default value |
|---|---|---|
Default value value |
AnyNumber | 0 |
Default value bitLength |
UIntBitLength | DEFAULT_UINT_BITS |
Default value isHexJson |
boolean |
false |
Returns: UInt
Methods
toHex
▸ toHex(): string
Overrides AbstractInt.toHex
Defined in codec/UInt.ts:36
description: Returns a hex string representation of the value
Returns: string
toU8a
▸ toU8a(isBare?: undefined | false | true): Uint8Array
Overrides AbstractInt.toU8a
Defined in codec/UInt.ts:48
description: Encodes the value as a Uint8Array as per the parity-codec specifications
Parameters:
| Name | Type | Description | ||
|---|---|---|---|---|
Optional isBare |
undefined |
false |
true |
true when the value has none of the type-specific prefixes (internal) |
Returns: Uint8Array