deprecate hmacSha256

This commit is contained in:
InsanusMokrassar 2022-06-30 13:19:37 +06:00
parent d4c5e849bf
commit 905c7e8eda
4 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,8 @@
## 0.11.11
* `Crypto`:
* `hmacSha256` has been deprecated
* `Ktor`:
* `Client`:
* `BodyPair` has been deprecated

View File

@ -1,3 +1,4 @@
package dev.inmo.micro_utils.crypto
@Deprecated("Deprecated due to incorrect of work sometimes and redundancy. Can be replaced by korlibs krypto")
expect fun SourceString.hmacSha256(key: String): String

View File

@ -8,6 +8,7 @@ external interface CryptoJs {
@JsNonModule
external val CryptoJS: CryptoJs
@Deprecated("Deprecated due to incorrect of work sometimes and redundancy. Can be replaced by korlibs krypto")
actual fun SourceString.hmacSha256(key: String): String {
return CryptoJS.asDynamic().HmacSHA256(this, key).toString().unsafeCast<String>()
}

View File

@ -3,6 +3,7 @@ package dev.inmo.micro_utils.crypto
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
@Deprecated("Deprecated due to incorrect of work sometimes and redundancy. Can be replaced by korlibs krypto")
actual fun SourceString.hmacSha256(key: String): String {
val mac = Mac.getInstance("HmacSHA256")