public class Util extends Object
| 构造器和说明 |
|---|
Util() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
asUnsignedByteArray(int length,
BigInteger value)
Return the passed in value as an unsigned byte array of the specified length, padded with
leading zeros as necessary..
|
static int |
bigEndianToInt(byte[] bs,
int off) |
static byte[] |
concatenate(byte[] a,
byte[] b)
Concatenate byte arrays a and b
|
static byte[] |
concatenate(byte[] a,
byte[] b,
byte[] c)
Concatenate byte arrays a, b and c
|
private static byte[] |
createRandom(int bitLen,
SecureRandom random)
Create a large integer of a specific bit length
|
static BigInteger |
createRandomBigInteger(int bitLen,
SecureRandom random)
Create a large integer of a specific bit length
|
static void |
intToBigEndian(int[] ns,
byte[] bs,
int off)
convert the numbers to big endian
|
static void |
intToBigEndian(int n,
byte[] bs,
int off)
convert the number to big endian
|
static int |
rotateShiftLeft(int x,
int k)
32-bit cyclic shift left by k bits
|
static String |
toUpperCase(String string)
A locale independent version of toUpperCase.
|
public static int rotateShiftLeft(int x,
int k)
x - 32-bit numberk - The number of bits that need to be rotated leftpublic static void intToBigEndian(int[] ns,
byte[] bs,
int off)
ns - list of numbersbs - Byte array to store converted numbersoff - start position of bit arraypublic static void intToBigEndian(int n,
byte[] bs,
int off)
n - numberbs - Byte array to store converted numbersoff - start position of bit arraypublic static int bigEndianToInt(byte[] bs,
int off)
public static BigInteger createRandomBigInteger(int bitLen, SecureRandom random)
bitLen - random - private static byte[] createRandom(int bitLen,
SecureRandom random)
throws IllegalArgumentException
bitLen - random - IllegalArgumentExceptionpublic static byte[] asUnsignedByteArray(int length,
BigInteger value)
length - the fixed length of the resultvalue - the value to be converted.public static byte[] concatenate(byte[] a,
byte[] b)
a - b - public static byte[] concatenate(byte[] a,
byte[] b,
byte[] c)
a - b - c - Copyright © 2024. All rights reserved.