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.String blake160​(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.String blake2b​(java.lang.String hexInput)
    Blake2b-256 hash function.
    static java.lang.String blake2bString​(java.lang.String utf8String)
    Blake2b-256 hash function that operates on a UTF-8 encoded String.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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 data
      offset - of start of data
      length - 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)