public class Checksum extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Checksum.Algorithm
Checksum algorithm.
|
static class |
Checksum.CRC32
CRC32
Checksum.Hasher. |
static class |
Checksum.CRC32C
CRC32C
Checksum.Hasher. |
static class |
Checksum.CRC64NVME
CRC64NVME
Checksum.Hasher copied from https://github.com/minio/crc64nvme. |
static interface |
Checksum.Hasher
Checksum hasher.
|
static class |
Checksum.MD5
MD5
Checksum.Hasher. |
static class |
Checksum.SHA1
SHA1
Checksum.Hasher. |
static class |
Checksum.SHA256
SHA256
Checksum.Hasher. |
static class |
Checksum.Type
Algorithm type.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
UNSIGNED_PAYLOAD |
static String |
ZERO_MD5_HASH
MD5 hash of zero length byte array.
|
static String |
ZERO_SHA256_HASH
SHA-256 hash of zero length byte array.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
base64String(byte[] sum)
Encodes the specified bytes to Base64 string.
|
static byte[] |
base64StringToSum(String sum)
Decodes the specified base64 encoded string to bytes.
|
static String |
hexString(byte[] sum)
Encodes the specified bytes to Base16 string.
|
static byte[] |
hexStringToSum(String sum)
Decodes the specified Base16 encoded string to bytes.
|
static Http.Headers |
makeHeaders(Map<Checksum.Algorithm,Checksum.Hasher> hashers,
boolean addContentSha256,
boolean addSha256Checksum)
Makes checksum headers for given hashers.
|
static Map<Checksum.Algorithm,Checksum.Hasher> |
newHasherMap(Checksum.Algorithm[] algorithms)
Creates hasher map for the specified algorithms.
|
static void |
update(Map<Checksum.Algorithm,Checksum.Hasher> hashers,
byte[] data,
int length)
Updates each hasher using the specified array of bytes, ending at the specified length.
|
static void |
update(Map<Checksum.Algorithm,Checksum.Hasher> hashers,
ByteBuffer buffer)
Updates each hasher using the specified byte buffer.
|
static void |
update(Map<Checksum.Algorithm,Checksum.Hasher> hashers,
RandomAccessFile file,
long size)
Updates each hasher using the specified file, ending at the specified size.
|
public static final String ZERO_MD5_HASH
public static final String ZERO_SHA256_HASH
public static final String UNSIGNED_PAYLOAD
public static String base64String(byte[] sum)
public static byte[] base64StringToSum(String sum)
public static String hexString(byte[] sum)
public static byte[] hexStringToSum(String sum)
public static Map<Checksum.Algorithm,Checksum.Hasher> newHasherMap(Checksum.Algorithm[] algorithms) throws MinioException
MinioExceptionpublic static void update(Map<Checksum.Algorithm,Checksum.Hasher> hashers, byte[] data, int length)
public static void update(Map<Checksum.Algorithm,Checksum.Hasher> hashers, RandomAccessFile file, long size) throws MinioException
MinioExceptionpublic static void update(Map<Checksum.Algorithm,Checksum.Hasher> hashers, ByteBuffer buffer) throws MinioException
MinioExceptionpublic static Http.Headers makeHeaders(Map<Checksum.Algorithm,Checksum.Hasher> hashers, boolean addContentSha256, boolean addSha256Checksum)