private fun generateMac(someUuid: String, base16HexStringKey: String): String {
val uuidIdBytes = someUuid.toByteArray(UTF_8)
val keyBytes = base16HexStringKey.toHexByteArray().decodeBase16()
return hmacSha512(uuidIdBytes, keyBytes).encodeBase16().toHexString()
}
It just generates hmac of some uuid string ... worth suspending?
u
uli
11/26/2020, 8:51 AM
how would you make this suspend?
u
ursus
11/26/2020, 4:41 PM
I dont know, since its not cancelable, maybe thats the rule of the thumb?
u
uli
11/26/2020, 4:42 PM
yes. if it is asnychronous make it suspend. if it is blocking it is blocking - you can only put it on a background thread in case it takes a relevant amount of time