public final class BigInt extends Object
NOTE: This class may eventually disappear, to be supplanted by big-endian byte arrays which hold both signed and unsigned arbitrary-precision integers.
Constructor and Description |
---|
BigInt(BigInteger i)
Constructs a "Big" integer from a "BigInteger", which must be positive
(or zero) in value.
|
BigInt(byte[] data)
Constructs a "Big" integer from a set of (big-endian) bytes.
|
BigInt(int i)
Constructs a "Big" integer from a normal Java integer.
|
Modifier and Type | Method and Description |
---|---|
int |
byteLength()
Returns the length of the data as a byte array.
|
boolean |
equals(BigInt other)
Returns true iff the parameter is numerically equivalent.
|
boolean |
equals(Object other)
Returns true iff the parameter is a numerically equivalent BigInt.
|
BigInteger |
toBigInteger()
Returns a BigInteger value which supports many arithmetic operations.
|
byte[] |
toByteArray()
Returns the data as a byte array.
|
int |
toInt()
Converts the "big" integer to a java primitive integer.
|
String |
toString()
Returns a hexadecimal printed representation.
|
public BigInt(byte[] data)
data
- a sequence of bytes, most significant bytes/digits first.
CONSUMED.public BigInt(BigInteger i)
public BigInt(int i)
i
- the java primitive integerpublic int toInt()
NumberFormatException
- if 32 bits is insufficient.public String toString()
public BigInteger toBigInteger()
public int byteLength()
public byte[] toByteArray()
java.math.BigInteger
).public boolean equals(Object other)
public boolean equals(BigInt other)
other
- the BigInt being compared with this one.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.