15 lines
430 B
Kotlin
15 lines
430 B
Kotlin
package dev.inmo.micro_utils.crypto
|
|
|
|
external interface CryptoJs {
|
|
fun MD5(data: String): String
|
|
}
|
|
|
|
@JsModule("crypto-js")
|
|
@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>()
|
|
}
|