Files
mac.kt/README.md
Infendro c11e80d221
Some checks failed
/ publish (push) Has been cancelled
/ test (push) Has been cancelled
bump version to 1.3.0, add targets
2026-01-22 12:51:45 +01:00

679 B

mac-kt

mac-kt is a Kotlin Multiplatform library that provides common Message Authentication Codes.

Supported algorithms:

  • HMAC

Installation

Add the following to your build.gradle.kts.

repositories {
    maven("https://git.infendro.com/api/packages/Infendro/maven")
}

dependencies {
    implementation("com.infendro:mac:1.3.0")
}

Usage

fun main() {
    // create an HMAC instance using SHA1
    val hmac = HMAC(SHA1)

    // generate MAC
    val key = "secret".encodeToByteArray()
    val value = "Hello World!".encodeToByteArray()
    val mac = hmac.hash(key, value)
}