hmacSha256 and hex

This commit is contained in:
2022-04-29 18:42:59 +06:00
parent 848bc5ec10
commit 31fbd3cad7
8 changed files with 75 additions and 1 deletions

View File

@@ -7,3 +7,9 @@ external interface CryptoJs {
@JsModule("crypto-js")
@JsNonModule
external val CryptoJS: CryptoJs
actual fun SourceString.hmacSha256(key: String) = CryptoJS.asDynamic().HmacSHA256(this, key).unsafeCast<String>()
actual fun SourceBytes.hex() = CryptoJS.asDynamic().format.Hex(this).unsafeCast<String>()
actual fun SourceString.hex() = CryptoJS.asDynamic().format.Hex(this).unsafeCast<String>()