Package org.nervos.ckb.crypto
Class Hash
java.lang.Object
org.nervos.ckb.crypto.Hash
public class Hash
extends java.lang.Object
Cryptographic hash functions.
-
Field Summary
Fields Modifier and Type Field Description protected static byte[]CKB_HASH_PERSONALIZATION -
Method Summary
Modifier and Type Method Description static java.lang.Stringblake160(java.lang.String hexInput)static byte[]blake2b(byte[] input)Blake2b-256 hash function.static byte[]blake2b(byte[] input, int offset, int length)Blake2b-256 hash function.static java.lang.Stringblake2b(java.lang.String hexInput)Blake2b-256 hash function.static java.lang.Stringblake2bString(java.lang.String utf8String)Blake2b-256 hash function that operates on a UTF-8 encoded String.
-
Field Details
-
CKB_HASH_PERSONALIZATION
protected static final byte[] CKB_HASH_PERSONALIZATION
-
-
Method Details
-
blake2b
public static java.lang.String blake2b(java.lang.String hexInput)Blake2b-256 hash function.- Parameters:
hexInput- hex encoded input data with optional 0x prefix- Returns:
- hash value as hex encoded string
-
blake2b
public static byte[] blake2b(byte[] input, int offset, int length)Blake2b-256 hash function.- Parameters:
input- binary encoded input dataoffset- of start of datalength- of data- Returns:
- hash value
-
blake2b
public static byte[] blake2b(byte[] input)Blake2b-256 hash function.- Parameters:
input- binary encoded input data- Returns:
- hash value
-
blake2bString
public static java.lang.String blake2bString(java.lang.String utf8String)Blake2b-256 hash function that operates on a UTF-8 encoded String.- Parameters:
utf8String- UTF-8 encoded string- Returns:
- hash value as hex encoded string
-
blake160
public static java.lang.String blake160(java.lang.String hexInput)
-