File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ use rand::Rng;
44use multibase:: { decode, encode, Base } ;
55
66fn bench_encode ( c : & mut Criterion ) {
7- let mut rng = rand:: thread_rng ( ) ;
8- let data: Vec < u8 > = ( 0 ..1024 ) . map ( |_| rng. gen ( ) ) . collect ( ) ;
7+ let mut rng = rand:: rng ( ) ;
8+ let data: Vec < u8 > = ( 0 ..1024 ) . map ( |_| rng. random ( ) ) . collect ( ) ;
99
1010 let mut group = c. benchmark_group ( "encode" ) ;
1111 group. bench_function ( "base32" , |b| {
@@ -27,8 +27,8 @@ fn bench_encode(c: &mut Criterion) {
2727}
2828
2929fn bench_decode ( c : & mut Criterion ) {
30- let mut rng = rand:: thread_rng ( ) ;
31- let data: Vec < usize > = ( 0 ..1024 ) . map ( |_| rng. gen ( ) ) . collect ( ) ;
30+ let mut rng = rand:: rng ( ) ;
31+ let data: Vec < usize > = ( 0 ..1024 ) . map ( |_| rng. random :: < u32 > ( ) as usize ) . collect ( ) ;
3232
3333 let base32 = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" ;
3434 let base58 = b"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" ;
You can’t perform that action at this time.
0 commit comments