Package io.minio
Class Checksum
java.lang.Object
io.minio.Checksum
Collection of checksum algorithms.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumChecksum algorithm.static classCRC32Checksum.Hasher.static classCRC32CChecksum.Hasher.static classCRC64NVMEChecksum.Hashercopied from https://github.com/minio/crc64nvme.static interfaceChecksum hasher.static classMD5Checksum.Hasher.static classSHA1Checksum.Hasher.static classSHA256Checksum.Hasher.static enumAlgorithm type. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringbase64String(byte[] sum) Encodes the specified bytes to Base64 string.static byte[]base64StringToSum(String sum) Decodes the specified base64 encoded string to bytes.static StringhexString(byte[] sum) Encodes the specified bytes to Base16 string.static byte[]hexStringToSum(String sum) Decodes the specified Base16 encoded string to bytes.static Http.HeadersmakeHeaders(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 voidupdate(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 voidupdate(Map<Checksum.Algorithm, Checksum.Hasher> hashers, ByteBuffer buffer) Updates each hasher using the specified byte buffer.static voidupdate(Map<Checksum.Algorithm, Checksum.Hasher> hashers, RandomAccessFile file, long size) Updates each hasher using the specified file, ending at the specified size.
-
Field Details
-
ZERO_MD5_HASH
MD5 hash of zero length byte array.- See Also:
-
ZERO_SHA256_HASH
SHA-256 hash of zero length byte array.- See Also:
-
UNSIGNED_PAYLOAD
- See Also:
-
-
Method Details
-
base64String
Encodes the specified bytes to Base64 string. -
base64StringToSum
Decodes the specified base64 encoded string to bytes. -
hexString
Encodes the specified bytes to Base16 string. -
hexStringToSum
Decodes the specified Base16 encoded string to bytes. -
newHasherMap
public static Map<Checksum.Algorithm,Checksum.Hasher> newHasherMap(Checksum.Algorithm[] algorithms) throws MinioException Creates hasher map for the specified algorithms.- Throws:
MinioException
-
update
Updates each hasher using the specified array of bytes, ending at the specified length. -
update
public static void update(Map<Checksum.Algorithm, Checksum.Hasher> hashers, RandomAccessFile file, long size) throws MinioExceptionUpdates each hasher using the specified file, ending at the specified size.- Throws:
MinioException
-
update
public static void update(Map<Checksum.Algorithm, Checksum.Hasher> hashers, ByteBuffer buffer) throws MinioExceptionUpdates each hasher using the specified byte buffer.- Throws:
MinioException
-
makeHeaders
public static Http.Headers makeHeaders(Map<Checksum.Algorithm, Checksum.Hasher> hashers, boolean addContentSha256, boolean addSha256Checksum) Makes checksum headers for given hashers.
-