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

izumi.fundamentals.platform.crypto.IzHashFunction.scala Maven / Gradle / Ivy

package izumi.fundamentals.platform.crypto

import izumi.fundamentals.platform.IzPlatformFunctionCollection
import izumi.fundamentals.platform.bytes.IzBytes.*

import java.nio.charset.StandardCharsets

trait IzHashFunction extends IzPlatformFunctionCollection {
  def id: IzHashId

  def hash(bytes: Array[Byte]): Array[Byte]

  final def hash(str: String): String = hash(str.getBytes(StandardCharsets.UTF_8)).toHex
}

sealed trait IzHashId

object IzHashId {
  case object SHA_256 extends IzHashId
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy