Package co.cryptoservice.sdk
Record Class HashResult
java.lang.Object
java.lang.Record
co.cryptoservice.sdk.HashResult
- Record Components:
algorithm- the algorithmdigest- the digest; lowercase hexlength- digest length in bytes
What
POST /v2/hash answers: compute a cryptographic hash.-
Constructor Summary
ConstructorsConstructorDescriptionHashResult(String algorithm, String digest, int length) Creates an instance of aHashResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.digest()Returns the value of thedigestrecord component.byte[]digest()decoded from hex.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intlength()Returns the value of thelengthrecord component.toString()Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted.
-
Constructor Details
-
Method Details
-
digestBytes
public byte[] digestBytes()digest()decoded from hex.- Returns:
- the bytes, or null when
digestis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
toString
Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
algorithm
Returns the value of thealgorithmrecord component.- Returns:
- the value of the
algorithmrecord component
-
digest
Returns the value of thedigestrecord component.- Returns:
- the value of the
digestrecord component
-
length
public int length()Returns the value of thelengthrecord component.- Returns:
- the value of the
lengthrecord component
-