#utf-8 #random #rand

rand-utf8

随机 utf8 工具

1 个不稳定版本

0.0.1 2022年6月13日

#22#utf8

Download history 663/week @ 2024-03-15 629/week @ 2024-03-22 417/week @ 2024-03-29 713/week @ 2024-04-05 688/week @ 2024-04-12 687/week @ 2024-04-19 966/week @ 2024-04-26 649/week @ 2024-05-03 551/week @ 2024-05-10 785/week @ 2024-05-17 762/week @ 2024-05-24 929/week @ 2024-05-31 569/week @ 2024-06-07 684/week @ 2024-06-14 640/week @ 2024-06-21 342/week @ 2024-06-28

2,409 每月下载量
用于 17 个 crate (2 直接)

MIT/Apache

9KB
166

rand-utf8

随机 utf8 工具。这个 crate 是 #![no_std] 但需要 alloc

示例

let mut rng = rand::rngs::SmallRng::seed_from_u64(0);
let my_str = rand_utf8::rand_utf8(&mut rng, 32);
assert_eq!(32, my_str.as_bytes().len());

许可: MIT/Apache-2.0


lib.rs:

随机 utf8 工具。这个 crate 是 #![no_std] 但需要 alloc

示例

let mut rng = rand::rngs::SmallRng::seed_from_u64(0);
let my_str = rand_utf8::rand_utf8(&mut rng, 32);
assert_eq!(32, my_str.as_bytes().len());

依赖

~305KB