public class UInt extends AbstractInt implements Compactable
UInt 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.
| Constructor and Description |
|---|
UInt(java.lang.Object value,
int bitLength) |
UInt(java.lang.Object value,
int bitLength,
boolean isHexJson) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
toHex()
Returns a hex string representation of the value
|
long |
toNumber() |
byte[] |
toU8a(boolean isBare) |
bitLength, eq, getEncodedLength, isEmpty, toBn, toJsonabs, add, and, andNot, bitCount, byteValueExact, clearBit, compareTo, divide, divideAndRemainder, doubleValue, equals, flipBit, floatValue, gcd, getLowestSetBit, hashCode, intValue, intValueExact, isProbablePrime, longValue, longValueExact, max, min, mod, modInverse, modPow, multiply, negate, nextProbablePrime, not, or, pow, probablePrime, remainder, setBit, shiftLeft, shiftRight, shortValueExact, signum, subtract, testBit, toByteArray, toString, toString, valueOf, xorclone, finalize, getClass, notify, notifyAll, wait, wait, waitbitLength, toBneq, getConstructorCodec, getEncodedLength, isEmpty, toJson, toU8apublic UInt(java.lang.Object value,
int bitLength,
boolean isHexJson)
public UInt(java.lang.Object value,
int bitLength)
public java.lang.String toHex()
Returns a hex string representation of the value
toHex in interface CodectoHex in class AbstractIntpublic byte[] toU8a(boolean isBare)
toU8a in interface CodectoU8a in class AbstractIntisBare - true when the value has none of the type-specific prefixes (internal) Encodes the value as a Uint8Array as per the parity-codec specificationspublic long toNumber()
toNumber in interface Compactable