update README
This commit is contained in:
35
README.md
35
README.md
@@ -1,18 +1,21 @@
|
||||
# Kotlin OTP
|
||||
# prng-kt
|
||||
|
||||
This library provides various [Pseudorandom Number Generator](https://en.wikipedia.org/wiki/Pseudorandom_number_generator)
|
||||
implementations in Kotlin Multiplatform.
|
||||
`prng-kt` is a Kotlin Multiplatform library that provides common pseudorandom number generators.
|
||||
|
||||
## Features
|
||||
Supported hash functions:
|
||||
- PRNG
|
||||
- LCG
|
||||
- CSPRNG
|
||||
- HMAC DRBG
|
||||
|
||||
* Generate random numbers using Kotlin's Random interface.
|
||||
* Seed the PRNGs to receive predictable results.
|
||||
* Reseed the PRNGs to add entropy to the following results.
|
||||
* [HMAC DRBG](https://en.wikipedia.org/wiki/NIST_SP_800-90A#Hash_DRBG_and_HMAC_DRBG)
|
||||
* Multiplatform support
|
||||
* JVM
|
||||
* JavaScript
|
||||
* Native (Linux)
|
||||
## Targets
|
||||
|
||||
| Target | Status |
|
||||
|------------------|---------------|
|
||||
| JVM | Supported |
|
||||
| JavaScript | Supported |
|
||||
| Native (Linux) | Supported |
|
||||
| Native (Windows) | Not Supported |
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -24,19 +27,19 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.infendro:random:1.1.0")
|
||||
implementation("com.infendro:prng:1.2.0")
|
||||
}
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```kotlin
|
||||
import com.infendro.hash.SHA256
|
||||
import com.infendro.random.PRNG
|
||||
import com.infendro.hash.sha2.`SHA-256`
|
||||
import com.infendro.random.csprng.CSPRNG
|
||||
|
||||
fun main() {
|
||||
// create a PRNG instance
|
||||
val rng = PRNG.HMAC(SHA256)
|
||||
val rng = CSPRNG.HMAC(`SHA-256`)
|
||||
|
||||
// seed the PRNG to receive predictable results
|
||||
rng.seed(/* some seed */)
|
||||
|
||||
Reference in New Issue
Block a user