deprecations

This commit is contained in:
Sergey Chernov 2024-08-25 02:31:33 +02:00
parent e8d90e7c71
commit a947271c3c

View File

@ -7,10 +7,12 @@ import org.komputing.khash.keccak.KeccakParameter
/**
* Computes the proper Keccak digest of [this] byte array based on the given [parameter]
*/
@Deprecated("will be removed, use Hash", ReplaceWith("Hash"))
fun ByteArray.digestKeccak(parameter: KeccakParameter): ByteArray {
return Keccak.digest(this, parameter)
}
@Deprecated("will be removed, use Hash", ReplaceWith("Hash"))
fun UByteArray.digestKeccak(parameter: KeccakParameter): UByteArray {
return Keccak.digest(this.asByteArray(), parameter).toUByteArray()
}
@ -18,6 +20,7 @@ fun UByteArray.digestKeccak(parameter: KeccakParameter): UByteArray {
/**
* Computes the proper Keccak digest of [this] string based on the given [parameter]
*/
@Deprecated("will be removed, use Hash", ReplaceWith("Hash"))
fun String.digestKeccak(parameter: KeccakParameter): ByteArray {
return Keccak.digest(encodeToByteArray(), parameter)
}