Update Home
1 parent
4b5067b30c
commit
a71e94e85a
1 file changed
-18
-18
@@ -27,21 +27,3 @@ dependencies {
|
||||
implementation("com.infendro:kdf:1.1.0")
|
||||
}
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```kotlin
|
||||
import com.infendro.hash.`SHA-256`
|
||||
import com.infendro.kdf.PBKDF2
|
||||
|
||||
fun main() {
|
||||
// create a PBKDF2 instance using HMAC SHA256
|
||||
// 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 hash = kdf.hash(value, salt)
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user