add README

This commit is contained in:
2025-10-03 13:34:13 +02:00
parent 0f8915a4a7
commit a137207310

43
README.md Normal file
View File

@@ -0,0 +1,43 @@
# Kotlin MAC
This library provides various Message Authentication Code implementations in Kotlin Multiplatform.
## Features
* Generate message authentication codes.
* [HMAC](https://en.wikipedia.org/wiki/HMAC)
* Multiplatform support
* JVM
* JavaScript
* Native (Linux)
## 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.2.2")
}
```
## Usage
```kotlin
import com.infendro.hash.SHA1
import com.infendro.mac.HMAC
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)
}
```