@@ -17,7 +17,7 @@ use zeroize::Zeroize;
1717use base64:: { alphabet:: BCRYPT , engine:: general_purpose:: NO_PAD , engine:: GeneralPurpose } ;
1818use core:: fmt;
1919#[ cfg( any( feature = "alloc" , feature = "std" ) ) ]
20- use { base64:: Engine , core:: convert:: AsRef , core:: str:: FromStr , getrandom :: getrandom } ;
20+ use { base64:: Engine , core:: convert:: AsRef , core:: str:: FromStr } ;
2121
2222mod bcrypt;
2323mod errors;
@@ -32,7 +32,7 @@ pub const DEFAULT_COST: u32 = 12;
3232pub const BASE_64 : GeneralPurpose = GeneralPurpose :: new ( & BCRYPT , NO_PAD ) ;
3333
3434#[ cfg( any( feature = "alloc" , feature = "std" ) ) ]
35- #[ derive( Debug , PartialEq ) ]
35+ #[ derive( Debug , PartialEq , Eq ) ]
3636/// A bcrypt hash result before concatenating
3737pub struct HashParts {
3838 cost : u32 ,
@@ -203,7 +203,7 @@ pub fn non_truncating_hash<P: AsRef<[u8]>>(password: P, cost: u32) -> BcryptResu
203203pub fn hash_with_result < P : AsRef < [ u8 ] > > ( password : P , cost : u32 ) -> BcryptResult < HashParts > {
204204 let salt = {
205205 let mut s = [ 0u8 ; 16 ] ;
206- getrandom ( & mut s) . map ( |_| s)
206+ getrandom:: fill ( & mut s) . map ( |_| s)
207207 } ?;
208208
209209 _hash_password ( password. as_ref ( ) , cost, salt, false )
@@ -220,7 +220,7 @@ pub fn non_truncating_hash_with_result<P: AsRef<[u8]>>(
220220) -> BcryptResult < HashParts > {
221221 let salt = {
222222 let mut s = [ 0u8 ; 16 ] ;
223- getrandom ( & mut s) . map ( |_| s)
223+ getrandom:: fill ( & mut s) . map ( |_| s)
224224 } ?;
225225
226226 _hash_password ( password. as_ref ( ) , cost, salt, true )
0 commit comments