mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-15 00:43:45 +02:00
add testutil module
Signed-off-by: Erik Hollensbe <git@hollensbe.org>
This commit is contained in:
parent
8ddd287787
commit
76c1e62014
1 changed files with 4 additions and 0 deletions
4
zerotier-network-hypervisor/src/util/testutil.rs
Normal file
4
zerotier-network-hypervisor/src/util/testutil.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
// from zeronsd
|
||||
pub fn randstring(len: u8) -> String {
|
||||
(0..len).map(|_| (rand::random::<u8>() % 26) + 'a' as u8).map(|c| if rand::random::<bool>() { (c as char).to_ascii_uppercase() } else { c as char }).map(|c| c.to_string()).collect::<Vec<String>>().join("")
|
||||
}
|
Loading…
Add table
Reference in a new issue