Package org.symbol.sdk.utils
Class Transforms
java.lang.Object
org.symbol.sdk.utils.Transforms
- Transforms
- Cryptographic transform helpers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]keccak_256(byte[]... parts) Hashes the in-order concatenation ofpartswith Keccak-256 (the pre-standardisation SHA3 used by NEM).static byte[]ripemdKeccak256(byte[] payload) Hashes payload with Keccak-256 and then hashes the result with RIPEMD-160.static byte[]sha3_256(byte[]... parts) Hashes the in-order concatenation ofpartswith SHA3-256.static byte[]sha3_256(byte[] first, byte[] second) Hashes the concatenation offirstandsecondwith SHA3-256.
-
Method Details
-
sha3_256
public static byte[] sha3_256(byte[] first, byte[] second) - Transforms.sha3_256
- Hashes the concatenation of
firstandsecondwith SHA3-256. Fixed-arity overload that avoids thebyte[][]varargs allocation on the common two-part hashing paths (merkle node pairs, leaf hashes).
- Parameters:
first- First input buffer.second- Second input buffer.- Returns:
- 32-byte SHA3-256 digest.
-
sha3_256
public static byte[] sha3_256(byte[]... parts) - Transforms.sha3_256
- Hashes the in-order concatenation of
partswith SHA3-256.
- Parameters:
parts- Input buffers to hash, in order.- Returns:
- 32-byte SHA3-256 digest.
-
keccak_256
public static byte[] keccak_256(byte[]... parts) - Transforms.keccak_256
- Hashes the in-order concatenation of
partswith Keccak-256 (the pre-standardisation SHA3 used by NEM).
- Parameters:
parts- Input buffers to hash, in order.- Returns:
- 32-byte Keccak-256 digest.
-
ripemdKeccak256
public static byte[] ripemdKeccak256(byte[] payload) - Transforms.ripemdKeccak256
- Hashes payload with Keccak-256 and then hashes the result with RIPEMD-160.
- Parameters:
payload- Input buffer to hash.- Returns:
- Hash result (20 bytes).
-