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 equal(int b,
int c)
b - a bytec - a bytepublic static int equal(byte[] b,
byte[] c)
b - a byte[]c - a byte[]public static int negative(int b)
b - the byte to check.public static int bit(byte[] h,
int i)
h - the byte array.i - the bit index.public static byte[] hexToBytes(String s)
s - the hex string to be converted.public static String bytesToHex(byte[] raw)
raw - the byte[] to be converted.Copyright © 2019. All rights reserved.