lisette-stdlib 0.2.13

Little language inspired by Rust that compiles to Go
Documentation
// Generated by Lisette bindgen
// Source: crypto/rand (Go stdlib)
// Go: 1.25.10
// Lisette: 0.2.1

import "go:io"
import "go:math/big"

/// Int returns a uniform random value in [0, max). It panics if max <= 0, and
/// returns an error if rand.Read returns one.
pub fn Int(rand: io.Reader, max: Ref<big.Int>) -> Result<Ref<big.Int>, error>

/// Prime returns a number of the given bit length that is prime with high probability.
/// Prime will return error for any error returned by rand.Read or if bits < 2.
pub fn Prime(rand: io.Reader, bits: int) -> Result<Ref<big.Int>, error>

/// Read fills b with cryptographically secure random bytes. It never returns an
/// error, and always fills b entirely.
/// 
/// Read calls [io.ReadFull] on [Reader] and crashes the program irrecoverably if
/// an error is returned. The default Reader uses operating system APIs that are
/// documented to never return an error on all but legacy Linux systems.
pub fn Read(mut b: Slice<byte>) -> Result<int, error>

/// Text returns a cryptographically random string using the standard RFC 4648 base32 alphabet
/// for use when a secret string, token, password, or other text is needed.
/// The result contains at least 128 bits of randomness, enough to prevent brute force
/// guessing attacks and to make the likelihood of collisions vanishingly small.
/// A future version may return longer texts as needed to maintain those properties.
pub fn Text() -> string

/// Reader is a global, shared instance of a cryptographically
/// secure random number generator. It is safe for concurrent use.
/// 
///   - On Linux, FreeBSD, Dragonfly, and Solaris, Reader uses getrandom(2).
///   - On legacy Linux (< 3.17), Reader opens /dev/urandom on first use.
///   - On macOS, iOS, and OpenBSD Reader, uses arc4random_buf(3).
///   - On NetBSD, Reader uses the kern.arandom sysctl.
///   - On Windows, Reader uses the ProcessPrng API.
///   - On js/wasm, Reader uses the Web Crypto API.
///   - On wasip1/wasm, Reader uses random_get.
/// 
/// In FIPS 140-3 mode, the output passes through an SP 800-90A Rev. 1
/// Deterministric Random Bit Generator (DRBG).
pub var Reader: io.Reader