getrandom-kotlin

Kotlin Multiplatform port of the
getrandom Rust crate (version
0.2.15) — a small cross-platform library for retrieving
cryptographically-secure random bytes from the OS-provided RNG.
Scope
getrandom mirrors the upstream Rust crate's single public function:
pub fn getrandom(dest: &mut [u8]) -> Result<(), Error>
becomes Kotlin:
public fun getrandom(dest: ByteArray): Result<Unit>
Each platform's actual delegates to the most appropriate OS-provided
entropy source:
Install
commonMain.dependencies {
implementation("io.github.kotlinmania:getrandom-kotlin:0.1.0")
}
Upstream
- Crate:
getrandom 0.2.15
- Source:
rust-random/getrandom
- License: MIT OR Apache-2.0
License
Dual-licensed under the MIT license and the Apache License, Version 2.0,
matching the upstream crate.