Crates.io | wasmium-random |
lib.rs | wasmium-random |
version | 1.0.0 |
source | src |
created_at | 2021-12-17 09:34:30.325951 |
updated_at | 2021-12-17 09:34:30.325951 |
description | Generate random numeric, alphabet, alphanumeric, BIP39 and EFF random bytes |
homepage | https://wasmium.network/opensource |
repository | https://github.com/wasmium/WasmiumRandom |
max_upload_size | |
id | 499609 |
size | 214,605 |
This crate uses the nanorand crate to generate random bytes from the English alphabet characters, Alphanumeric characters and numeric characters.
This crate does not allocate on the heap. Any heap allocation is a bug, please file an issue on Github. Parallelism is planned at a later date.
Import the crate
use wasmium_random::WasmiumRandom;
a-z,A-Z
. This is useful for cryptographic applications.use wasmium_random::WasmiumRandom;
// Generate 12 random bytes
WasmiumRandom::secure_alphabet12();
// Generate 24 random bytes
WasmiumRandom::secure_alphabet24();
// Generate 32 random bytes
WasmiumRandom::secure_alphabet32();
// Generate 64 random bytes
WasmiumRandom::secure_alphabet64();
// Generate 128 random bytes
WasmiumRandom::secure_alphabet128();
// Generate 256 random bytes
WasmiumRandom::secure_alphabet256();
// Generate 512 random bytes
WasmiumRandom::secure_alphabet512();
0-9,a-z,A-Z
. This is useful for cryptographic applications.use wasmium_random::WasmiumRandom;
// Generate 12 random bytes securely
WasmiumRandom::secure_alphanumeric12();
// Generate 24 random bytes securely
WasmiumRandom::secure_alphanumeric24();
// Generate 32 random bytes securely
WasmiumRandom::secure_alphanumeric32();
// Generate 64 random bytes securely
WasmiumRandom::secure_alphanumeric64();
// Generate 128 random bytes securely
WasmiumRandom::secure_alphanumeric128();
// Generate 512 random bytes securely
WasmiumRandom::secure_alphanumeric512();
0-9
. This is useful for cryptographic applications.use wasmium_random::WasmiumRandom;
// Generate 12 random bytes securely
WasmiumRandom::secure_numeric12();
// Generate 24 random bytes securely
WasmiumRandom::secure_numeric24();
// Generate 32 random bytes securely
WasmiumRandom::secure_numeric32();
// Generate 64 random bytes securely
WasmiumRandom::secure_numeric64();
// Generate 128 random bytes securely
WasmiumRandom::secure_numeric128();
// Generate 512 random bytes securely
WasmiumRandom::secure_numeric512();
a-z,A-Z
.use wasmium_random::WasmiumRandom;
// Generate 12 random bytes
WasmiumRandom::wyrand_alphabet12();
// Generate 24 random bytes
WasmiumRandom::wyrand_alphabet24();
// Generate 32 random bytes
WasmiumRandom::secure_alphabet32();
// Generate 64 random bytes
WasmiumRandom::wyrand_alphabet64();
// Generate 128 random bytes
WasmiumRandom::wyrand_alphabet128();
// Generate 256 random bytes
WasmiumRandom::wyrand_alphabet256();
// Generate 512 random bytes
WasmiumRandom::wyrand_alphabet512();
0-9,a-z,A-Z
.use wasmium_random::WasmiumRandom;
// Generate 12 random bytes
WasmiumRandom::wyrand_alphanumeric12();
// Generate 24 random bytes
WasmiumRandom::wyrand_alphanumeric24();
// Generate 32 random bytes
WasmiumRandom::wyrand_alphanumeric32();
// Generate 64 random bytes
WasmiumRandom::wyrand_alphanumeric64();
// Generate 128 random bytes
WasmiumRandom::wyrand_alphanumeric128();
// Generate 512 random bytes
WasmiumRandom::wyrand_alphanumeric512();
0-9
.use wasmium_random::WasmiumRandom;
// Generate 12 random bytes securely
WasmiumRandom::wyrand_numeric12();
// Generate 24 random bytes securely
WasmiumRandom::wyrand_numeric24();
// Generate 32 random bytes securely
WasmiumRandom::wyrand_numeric32();
// Generate 64 random bytes securely
WasmiumRandom::wyrand_numeric64();
// Generate 128 random bytes securely
WasmiumRandom::wyrand_numeric128();
// Generate 512 random bytes securely
WasmiumRandom::wyrand_numeric512();
NOTE:
The bytes from characters can be generated to upto 2048 bytes. See the submodule
documentation.
The BIP39, EFF shortlist and EFF largelist of English alphabet words are also supported.
CC0-1.0
or Apache-2.0