Updated on 2026-08-14

This commit is contained in:
Tangem 2022-09-17 15:04:50 +04:00
parent 4d73b7725e
commit d8be65f5f7
41 changed files with 983 additions and 767 deletions

View file

@ -0,0 +1,10 @@
package com.tangem.domain.common.extensions
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
fun ByteArray.calculateHmacSha256(key: ByteArray): ByteArray {
val mac: Mac = Mac.getInstance("HmacSHA256")
mac.init(SecretKeySpec(key, "HmacSHA256"))
return mac.doFinal(this)
}