Package convex.core.crypto
Class Hashing
java.lang.Object
convex.core.crypto.Hashing
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageDigest
Gets the Convex default MessageDigest.static MessageDigest
Gets a MessageDigest for Keccak256.static MessageDigest
Gets a thread-local instance of a SHA256 MessageDigeststatic MessageDigest
Gets a thread-local instance of a SHA3-256 MessageDigeststatic Hash
keccak256
(byte[] data) Computes the KECCAK-256 hash of byte datastatic Hash
sha256
(byte[] data) Computes the SHA-256 hash of byte datastatic Hash
Computes the SHA-256 hash of a stringstatic Hash
sha3
(byte[] data) Computes the SHA3-256 hash of byte datastatic Hash
Computes the SHA-256 hash of a string
-
Constructor Details
-
Hashing
public Hashing()
-
-
Method Details
-
sha3
-
sha3
Computes the SHA3-256 hash of byte data- Parameters:
data
- Byte array to hash- Returns:
- SHA3-256 Hash value
-
getSHA3Digest
Gets a thread-local instance of a SHA3-256 MessageDigest- Returns:
- MessageDigest instance
-
getDigest
Gets the Convex default MessageDigest. Guaranteed thread safe, will be either a new or ThreadLocal instance.- Returns:
- MessageDigest
-
getKeccak256Digest
Gets a MessageDigest for Keccak256. Guaranteed thread safe, will be either a new or ThreadLocal instance.- Returns:
- MessageDigest
-
getSHA256Digest
Gets a thread-local instance of a SHA256 MessageDigest- Returns:
- MessageDigest instance
-
sha256
Computes the SHA-256 hash of byte data- Parameters:
data
- Byte array to hash- Returns:
- Hash value
-
keccak256
Computes the KECCAK-256 hash of byte data- Parameters:
data
- Byte array to hash- Returns:
- Hash value
-
sha256
-