Files
mac.kt/README.md
Infendro 1f31ea9509
All checks were successful
/ test (pull_request) Successful in 42s
Bump version to 1.5.0
2026-03-11 22:58:59 +01:00

35 lines
681 B
Markdown

# mac-kt
`mac-kt` is a Kotlin Multiplatform library that provides common [Message Authentication Codes](https://en.wikipedia.org/wiki/Message_authentication_code).
Supported algorithms:
- HMAC
## Installation
Add the following to your `build.gradle.kts`.
```kotlin
repositories {
maven("https://git.infendro.com/api/packages/Infendro/maven")
}
dependencies {
implementation("com.infendro:mac:1.5.0")
}
```
## Usage
```kotlin
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)
}
```