Object

com.ubirch.crypto.hash

HashUtil

Related Doc: package hash

Permalink

object HashUtil

author: cvandrei since: 2016-07-28

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HashUtil
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashToBase64(byteArray: Array[Byte]): String

    Permalink

    Convenience method correctly converting a hash from byte array to a Base64 encoded string.

    Convenience method correctly converting a hash from byte array to a Base64 encoded string.

    byteArray

    hash represented as byte array

    returns

    input converted to Base64 encoded string

  12. def hashToBytes(hexString: String): Array[Byte]

    Permalink

    Convenience method correctly converting a hash from hex string to byte array.

    Convenience method correctly converting a hash from hex string to byte array.

    hexString

    hash represented as hex string

    returns

    input converted to byte array

  13. def hashToHex(byteArray: Array[Byte]): String

    Permalink

    Convenience method correctly converting a hash from byte array to hex string.

    Convenience method correctly converting a hash from byte array to hex string.

    byteArray

    hash represented as byte array

    returns

    input converted to hex string

  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def pbkdf2Base64(data: String, salt: String, iterations: Int = pbkdf2IterationsDefault): String

    Permalink

    Convenience method to get PBKDF2 hash as Base64 encoded string.

    Convenience method to get PBKDF2 hash as Base64 encoded string.

    data

    data to hash

    salt

    salt to use with hash function

    iterations

    bcrypt iterations count

    returns

    base64(hash)

  19. def pbkdf2ByteArray(data: String, salt: String, iterations: Int = pbkdf2IterationsDefault): Array[Byte]

    Permalink

    Convenience method to get PBKDF2 hash as byte array.

    Convenience method to get PBKDF2 hash as byte array.

    data

    data to hash

    salt

    salt to use with hash function

    iterations

    bcrypt iterations count

    returns

    hash as byte array

  20. def pbkdf2Digest(data: String, salt: String, iterations: Int = pbkdf2IterationsDefault): Digest

    Permalink

    Gives us the Digest of a PBKDF2 hash.

    Gives us the Digest of a PBKDF2 hash.

    data

    data to hash

    salt

    salt to use with hash function

    iterations

    bcrypt iterations count

    returns

    digest with hashed input data

  21. def pbkdf2HexString(data: String, salt: String, iterations: Int = pbkdf2IterationsDefault): String

    Permalink

    Convenience method to get PBKDF2 hash as hexString.

    Convenience method to get PBKDF2 hash as hexString.

    data

    data to hash

    salt

    salt to use with hash function

    iterations

    bcrypt iterations count

    returns

    hash as hex string

  22. final val pbkdf2IterationsDefault: Int

    Permalink
  23. def randomSha256Hashes(elementCount: Int = Random.nextInt(30000)): Seq[String]

    Permalink

    Convenience method generating random hashes (useful for creating a genesis block or in tests).

    Convenience method generating random hashes (useful for creating a genesis block or in tests).

    elementCount

    number of randomly generated hashes

    returns

    sequence of random hashes

  24. def sha256(binData: Array[Byte]): Array[Byte]

    Permalink

    returns

    sha256 hash as array of bytes

  25. def sha256Base64(binData: Array[Byte]): String

    Permalink

    returns

    sha256 hash as base64 encoded string

  26. def sha256Base64(data: String): String

    Permalink

    Convenience method that gives us the hash of the input as Base64 encoded string.

    Convenience method that gives us the hash of the input as Base64 encoded string.

    data

    data to hash

    returns

    Base64 encoded string representation: SHA-256 hash of input data

  27. def sha256ByteArray(data: String): Array[Byte]

    Permalink

    Convenience method that gives us the hash of the input as byte array.

    Convenience method that gives us the hash of the input as byte array.

    data

    data to hash

    returns

    byte array representation: SHA-256 hash of input data

  28. def sha256Digest(data: String): Digest

    Permalink

    Gives us the Digest of a hash based on which call all sorts of methods (including conversion to hexString or byteArray).

    Gives us the Digest of a hash based on which call all sorts of methods (including conversion to hexString or byteArray).

    data

    data to hash

    returns

    digest with hash of input data

  29. def sha256Hex(binData: Array[Byte]): String

    Permalink

    returns

    sha256 hash as hex encoded string

  30. def sha256HexString(data: String): String

    Permalink

    Convenience method that gives us the hash of the input as hexString.

    Convenience method that gives us the hash of the input as hexString.

    data

    data to hash

    returns

    hex string representation: SHA-256 hash of input data

  31. def sha512(binData: Array[Byte]): Array[Byte]

    Permalink

    returns

    sha512 hash as array of bytes

  32. def sha512Base64(binData: Array[Byte]): String

    Permalink

    returns

    sha512 hash as base64 encoded string

  33. def sha512Base64(data: String): String

    Permalink

    Convenience method that gives us the hash of the input as Base64 encoded string.

    Convenience method that gives us the hash of the input as Base64 encoded string.

    data

    data to hash

    returns

    Base64 encoded string representation: SHA-512 hash of input data

  34. def sha512ByteArray(data: String): Array[Byte]

    Permalink

    Convenience method that gives us the hash of the input as byte array.

    Convenience method that gives us the hash of the input as byte array.

    data

    data to hash

    returns

    byte array representation: SHA-512 hash of input data

  35. def sha512Digest(data: String): Digest

    Permalink

    Gives us the Digest of a hash based on which call all sorts of methods (including conversion to hexString or byteArray).

    Gives us the Digest of a hash based on which call all sorts of methods (including conversion to hexString or byteArray).

    data

    data to hash

    returns

    digest with hash of input data

  36. def sha512Hex(binData: Array[Byte]): String

    Permalink

    returns

    sha512 hash as hex encoded string

  37. def sha512HexString(data: String): String

    Permalink

    Convenience method that gives us the hash of the input as hexString.

    Convenience method that gives us the hash of the input as hexString.

    data

    data to hash

    returns

    hex string representation: SHA-512 hash of input data

  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  39. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  40. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped