public class BigIntegerUtils
extends java.lang.Object
Obtained from Apache Xerces and Aduna Software code on java2s.com.
| Modifier and Type | Method and Description |
|---|---|
static java.math.BigInteger |
bigIntegerFromBytes(byte[] bytes)
Converts a byte array to a positive BigInteger
|
static byte[] |
bigIntegerToBytes(java.math.BigInteger bigInteger)
Converts a BigInteger into a byte array ignoring the sign of the BigInteger, according to RFC2945 specification
|
static java.math.BigInteger |
fromHex(java.lang.String hex)
Decodes the specified hex string into a big integer.
|
static java.lang.String |
toHex(java.math.BigInteger bigint)
Encodes the specified big integer into a hex string.
|
public static java.lang.String toHex(java.math.BigInteger bigint)
bigint - the value to convert to a hexidecimal stringnull if the
input is undefined.public static java.math.BigInteger fromHex(java.lang.String hex)
hex - The hex encoded string to decode.null if decoding
failed.public static java.math.BigInteger bigIntegerFromBytes(byte[] bytes)
bytes - byte array in big endian unsigned RFC2945 formatpublic static byte[] bigIntegerToBytes(java.math.BigInteger bigInteger)
bigInteger - BigInteger, must not be null, should not be negative