upgrade
Some checks failed
/ publish (pull_request) Has been cancelled
/ test (pull_request) Has been cancelled
/ publish (push) Has been cancelled
/ test (push) Has been cancelled

This commit is contained in:
2026-02-03 23:42:46 +01:00
parent 8686be3346
commit f78b10f565
7 changed files with 79 additions and 78 deletions

View File

@@ -5,15 +5,6 @@
Supported algorithms:
- PBKDF2
## Targets
| Target | Status |
|------------------|---------------|
| JVM | Supported |
| JavaScript | Supported |
| Native (Linux) | Supported |
| Native (Windows) | Not Supported |
## Installation
Add the following to your `build.gradle.kts`.
@@ -24,24 +15,21 @@ repositories {
}
dependencies {
implementation("com.infendro:kdf:1.1.0")
implementation("com.infendro:kdf:1.2.0")
}
```
## Usage
```kotlin
import com.infendro.hash.`SHA-256`
import com.infendro.kdf.PBKDF2
fun main() {
// create a PBKDF2 instance using HMAC SHA256
// create a PBKDF2 instance using HMAC SHA-256
// this example uses 32 bytes of length and 100_000 iterations
val kdf = PBKDF2(32, 100_000, `SHA-256`)
// securely hash value with some salt
val value = "password".encodeToByteArray().asUByteArray()
val salt = "salt".encodeToByteArray().asUByteArray()
val value = "password".encodeToByteArray()
val salt = "salt".encodeToByteArray()
val hash = kdf.hash(value, salt)
}
```