klyn.cryptography.Mac.doFinal
method
public doFinal(text as String = null) as Digest throws CryptoException:
Description

Computes the MAC for the buffered text and an optional final chunk.

Parameters
ParameterDescription
textOptional final UTF-8 chunk.
Returns

Structured MAC result.

Throws
  • CryptoException when the key is missing or the operation fails.
Example
import klyn.cryptography

mac = Hmac(SHA256())
mac.init("secret")
digest = mac.doFinal("hello")
print(digest.hex)