public class ArrayUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static int |
compare(byte[] b,
byte[] c)
NON constant-time lexicographical byte[] comparison.
|
static byte[] |
concat(byte[]... arrays)
Concatenates byte arrays and returns the result.
|
static byte[] |
duplicate(byte[] src)
Creates duplicate of given array
|
static int |
getBit(byte[] h,
int i)
Gets the i'th bit of a byte array.
|
static int |
isEqualConstantTime(byte[] b,
byte[] c)
Constant-time byte[] comparison.
|
static byte[][] |
split(byte[] bytes,
int splitIndex)
Splits a single array into two arrays.
|
static java.math.BigInteger |
toBigInteger(byte[] bytes)
Converts a little endian byte array to a BigInteger.
|
static byte[] |
toByteArray(java.math.BigInteger value,
int numBytes)
Converts a BigInteger to a little endian byte array.
|
public static byte[] duplicate(byte[] src)
src - The array to duplicate.public static byte[] concat(byte[]... arrays)
arrays - The arrays.public static byte[][] split(byte[] bytes,
int splitIndex)
bytes - The input array.splitIndex - The index at which the array should be split.public static byte[] toByteArray(java.math.BigInteger value,
int numBytes)
value - The value to convert.numBytes - The number of bytes in the destination array.public static java.math.BigInteger toBigInteger(byte[] bytes)
bytes - The bytes to convert.public static int isEqualConstantTime(byte[] b,
byte[] c)
b - An array.c - An array.public static int compare(byte[] b,
byte[] c)
b - first of arrays to compare.c - second of arrays to compare.public static int getBit(byte[] h,
int i)
h - The byte array.i - The bit index.