File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,10 @@ impl ScramSha256 {
136
136
/// Constructs a new instance which will use the provided password for authentication.
137
137
pub fn new ( password : & [ u8 ] , channel_binding : ChannelBinding ) -> ScramSha256 {
138
138
// rand 0.5's ThreadRng is cryptographically secure
139
- let mut rng = rand:: thread_rng ( ) ;
139
+ let mut rng = rand:: rng ( ) ;
140
140
let nonce = ( 0 ..NONCE_LENGTH )
141
141
. map ( |_| {
142
- let mut v = rng. gen_range ( 0x21u8 ..0x7e ) ;
142
+ let mut v = rng. random_range ( 0x21u8 ..0x7e ) ;
143
143
if v == 0x2c {
144
144
v = 0x7e
145
145
}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const SCRAM_DEFAULT_SALT_LEN: usize = 16;
28
28
/// special characters that would require escaping in an SQL command.
29
29
pub fn scram_sha_256 ( password : & [ u8 ] ) -> String {
30
30
let mut salt: [ u8 ; SCRAM_DEFAULT_SALT_LEN ] = [ 0 ; SCRAM_DEFAULT_SALT_LEN ] ;
31
- let mut rng = rand:: thread_rng ( ) ;
31
+ let mut rng = rand:: rng ( ) ;
32
32
rng. fill_bytes ( & mut salt) ;
33
33
scram_sha_256_salt ( password, salt)
34
34
}
Original file line number Diff line number Diff line change 44
44
45
45
let mut indices = ( 0 ..num_hosts) . collect :: < Vec < _ > > ( ) ;
46
46
if config. load_balance_hosts == LoadBalanceHosts :: Random {
47
- indices. shuffle ( & mut rand:: thread_rng ( ) ) ;
47
+ indices. shuffle ( & mut rand:: rng ( ) ) ;
48
48
}
49
49
50
50
let mut error = None ;
@@ -101,7 +101,7 @@ where
101
101
. collect :: < Vec < _ > > ( ) ;
102
102
103
103
if config. load_balance_hosts == LoadBalanceHosts :: Random {
104
- addrs. shuffle ( & mut rand:: thread_rng ( ) ) ;
104
+ addrs. shuffle ( & mut rand:: rng ( ) ) ;
105
105
}
106
106
107
107
let mut last_err = None ;
You can’t perform that action at this time.
0 commit comments