All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wavesplatform.crypto.Sha256.scala Maven / Gradle / Ivy

The newest version!
package com.wavesplatform.crypto

import java.security.MessageDigest

object Sha256 {
  private[this] val digest = new ThreadLocal[MessageDigest]() {
    override def initialValue(): MessageDigest = MessageDigest.getInstance("SHA-256")
  }

  def hash(message: Array[Byte]): Array[Byte] = {
    val result = digest.get().digest(message)
    digest.get().reset()
    result
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy