public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static int | bit(byte[] h,
int i)Get the i'th bit of a byte array. |
static String | bytesToHex(byte[] raw)Converts bytes to a hex string. |
static int | equal(byte[] b,
byte[] c)Constant-time byte[] comparison. |
static int | equal(int b,
int c)Constant-time byte comparison. |
static byte[] | hexToBytes(String s)Converts a hex string to bytes. |
static int | negative(int b)Constant-time determine if byte is negative. |
public static int bit(byte[] h,
int i)h - the byte array.i - the bit index.public static String bytesToHex(byte[] raw)
raw - the byte[] to be converted.public static int equal(byte[] b,
byte[] c)b - a byte[]c - a byte[]public static int equal(int b,
int c)b - a bytec - a bytepublic static byte[] hexToBytes(String s)
s - the hex string to be converted.public static int negative(int b)
b - the byte to check.