1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
//! This crate uses the [nanorand](docs.rs/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.
//!
//! ### Usage
//! Import the crate
//! ```
//! use wasmium_random::WasmiumRandom;
//! ```
//!
//! ### Generate bytes securely from a CSPRNG using the alphabet `a-z,A-Z`. This is useful for cryptographic applications.
//! ```rust
//! # 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();
//! ```
//!
//! ### Generate bytes securely from a CSPRNG using the alphanumeric characters `0-9,a-z,A-Z`. This is useful for cryptographic applications.
//! ```rust
//! # 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();
//! ```
//!
//! ### Generate bytes securely from a CSPRNG using the numeric characters `0-9`. This is useful for cryptographic applications.
//! ```rust
//! # 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();
//! ```
//!
//!
//! ## Non-cryptographically secure random bytes are also supported using the super fast [Wyrand](nanorand::WyRand) PRNG.
//! ### Generate bytes from a PRNG using the alphabet `a-z,A-Z`.
//! ```rust
//! # 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();
//! ```
//!
//! ### Generate bytes from a PRNG using the alphanumeric characters `0-9,a-z,A-Z`.
//! ```rust
//! # 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();
//! ```
//!
//! ### Generate bytes from a PRNG using the numeric characters `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.
//!
pub use *;
pub use *;
pub use *;
pub use *;