@@ -7,55 +7,55 @@ describe('getHashers test with all hashing algorithms', () => {
7
7
it ( 'testing unsalted_md5' , ( ) => {
8
8
const hash_password = "5f4dcc3b5aa765d61d8327deb882cf99" ;
9
9
const h = hashers . identifyHasher ( hash_password ) ;
10
- assert . equal ( h , 'unsalted_md5' , 'Testing unsalted_md5 from Django' ) ;
10
+ assert . strictEqual ( h , 'unsalted_md5' , 'Testing unsalted_md5 from Django' ) ;
11
11
} ) ;
12
12
13
13
it ( 'testing unsalted_sha1' , ( ) => {
14
14
const hash_password = "sha1$$5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" ;
15
15
const h = hashers . identifyHasher ( hash_password ) ;
16
- assert . equal ( h , 'unsalted_sha1' , 'Testing unsalted_sha1 from Django' ) ;
16
+ assert . strictEqual ( h , 'unsalted_sha1' , 'Testing unsalted_sha1 from Django' ) ;
17
17
} ) ;
18
18
19
19
it ( 'testing sha1' , ( ) => {
20
20
const hash_password = "sha1$vCl9KSmkkKHJ$3864dc6b8ea10d757290660df171a0f7c5fc3b36" ;
21
21
const h = hashers . identifyHasher ( hash_password ) ;
22
- assert . equal ( h , 'sha1' , 'Testing sha1 from Django' ) ;
22
+ assert . strictEqual ( h , 'sha1' , 'Testing sha1 from Django' ) ;
23
23
} ) ;
24
24
25
25
it ( 'testing md5' , ( ) => {
26
26
const hash_password = "md5$UyDBYR3ttBkN$510f43d5da1a0ef16ed4ef361cbfef5e" ;
27
27
const h = hashers . identifyHasher ( hash_password ) ;
28
- assert . equal ( h , 'md5' , 'Testing md5 from Django' ) ;
28
+ assert . strictEqual ( h , 'md5' , 'Testing md5 from Django' ) ;
29
29
} ) ;
30
30
31
31
it ( 'testing pbkdf2_sha256' , ( ) => {
32
32
const hash_password = "pbkdf2_sha256$36000$c8SBx74kl0XA$bAmKN/CgJGlh7xpuxmvQX9ypsnjV68JqZlfLxWDYGBk=" ;
33
33
const h = hashers . identifyHasher ( hash_password ) ;
34
- assert . equal ( h , 'pbkdf2_sha256' , 'Testing pbkdf2_sha256 from Django' ) ;
34
+ assert . strictEqual ( h , 'pbkdf2_sha256' , 'Testing pbkdf2_sha256 from Django' ) ;
35
35
} ) ;
36
36
37
37
it ( 'testing argon2' , ( ) => {
38
38
const hash_password = "argon2$argon2i$v=19$m=512,t=2,p=2$UXZPOFhoSUxrWmhQ$CCPcRG8t+LOJB8H1zL+Prw" ;
39
39
const h = hashers . identifyHasher ( hash_password ) ;
40
- assert . equal ( h , 'argon2' , 'Testing argon2 from Django' ) ;
40
+ assert . strictEqual ( h , 'argon2' , 'Testing argon2 from Django' ) ;
41
41
} ) ;
42
42
43
43
it ( 'testing pbkdf2_sha1' , ( ) => {
44
44
const hash_password = "pbkdf2_sha1$36000$P6Y4I7YXzZpB$LrWCTPqWtIdPFYY5jt+w56QJGR0=" ;
45
45
const h = hashers . identifyHasher ( hash_password ) ;
46
- assert . equal ( h , 'pbkdf2_sha1' , 'Testing pbkdf2_sha1 from Django' ) ;
46
+ assert . strictEqual ( h , 'pbkdf2_sha1' , 'Testing pbkdf2_sha1 from Django' ) ;
47
47
} ) ;
48
48
49
49
it ( 'testing bcrypt_sha256' , ( ) => {
50
50
const hash_password = "bcrypt_sha256$$2b$12$7swZEQstS0pPWpvL4LQ/guW75Lc8OCRY1V1zq17jUlsQqyLhVuzGa" ;
51
51
const h = hashers . identifyHasher ( hash_password ) ;
52
- assert . equal ( h , 'bcrypt_sha256' , 'Testing bcrypt_sha256 from Django' ) ;
52
+ assert . strictEqual ( h , 'bcrypt_sha256' , 'Testing bcrypt_sha256 from Django' ) ;
53
53
} ) ;
54
54
55
55
it ( 'testing bcrypt' , ( ) => {
56
56
const hash_password = "bcrypt$$2b$12$QssVJfXwb178/8i1CUMTsOoRhi7.oFF5FVdxbM1ZxCnd6iDfTZaVO" ;
57
57
const h = hashers . identifyHasher ( hash_password ) ;
58
- assert . equal ( h , 'bcrypt' , 'Testing bcrypt from Django' ) ;
58
+ assert . strictEqual ( h , 'bcrypt' , 'Testing bcrypt from Django' ) ;
59
59
} ) ;
60
60
} ) ;
61
61
@@ -64,63 +64,63 @@ describe('Test all password hashing algorithms encode and verify methods', () =>
64
64
const h = new hashers . UnsaltedMD5PasswordHasher ( ) ;
65
65
const hashPassword = await h . encode ( 'password' ) ;
66
66
const verify = await h . verify ( 'password' , hashPassword ) ;
67
- assert . equal ( verify , true , 'Testing unsalted_md5 encode and verify from Django' ) ;
67
+ assert . strictEqual ( verify , true , 'Testing unsalted_md5 encode and verify from Django' ) ;
68
68
} ) ;
69
69
70
70
it ( 'testing unsalted_sha1 encode' , async ( ) => {
71
71
const h = new hashers . UnsaltedSHA1PasswordHasher ( ) ;
72
72
const hashPassword = await h . encode ( 'password' ) ;
73
73
const verify = await h . verify ( 'password' , hashPassword ) ;
74
- assert . equal ( verify , true , 'Testing unsalted_sha1 encode and verify from Django' ) ;
74
+ assert . strictEqual ( verify , true , 'Testing unsalted_sha1 encode and verify from Django' ) ;
75
75
} ) ;
76
76
77
77
it ( 'testing sha1 encode' , async ( ) => {
78
78
const h = new hashers . SHA1PasswordHasher ( ) ;
79
79
const hashPassword = await h . encode ( 'password' ) ;
80
80
const verify = await h . verify ( 'password' , hashPassword ) ;
81
- assert . equal ( verify , true , 'Testing sha1 encode and verify from Django' ) ;
81
+ assert . strictEqual ( verify , true , 'Testing sha1 encode and verify from Django' ) ;
82
82
} ) ;
83
83
84
84
it ( 'testing md5 encode' , async ( ) => {
85
85
const h = new hashers . MD5PasswordHasher ( ) ;
86
86
const hashPassword = await h . encode ( 'password' ) ;
87
87
const verify = await h . verify ( 'password' , hashPassword ) ;
88
- assert . equal ( verify , true , 'Testing md5 encode and verify from Django' ) ;
88
+ assert . strictEqual ( verify , true , 'Testing md5 encode and verify from Django' ) ;
89
89
} ) ;
90
90
91
91
it ( 'testing pbkdf2_sha256 encode' , async ( ) => {
92
92
const h = new hashers . PBKDF2PasswordHasher ( ) ;
93
93
const hashPassword = await h . encode ( 'password' ) ;
94
94
const verify = await h . verify ( 'password' , hashPassword ) ;
95
- assert . equal ( verify , true , 'Testing pbkdf2_sha256 encode and verify from Django' ) ;
95
+ assert . strictEqual ( verify , true , 'Testing pbkdf2_sha256 encode and verify from Django' ) ;
96
96
} ) ;
97
97
98
98
it ( 'testing argon2 encode' , async ( ) => {
99
99
const h = new hashers . Argon2PasswordHasher ( ) ;
100
100
const hashPassword = await h . encode ( 'password' ) ;
101
101
const verify = await h . verify ( 'password' , hashPassword ) ;
102
- assert . equal ( verify , true , 'Testing argon2 encode and verify from Django' ) ;
102
+ assert . strictEqual ( verify , true , 'Testing argon2 encode and verify from Django' ) ;
103
103
} ) ;
104
104
105
105
it ( 'testing pbkdf2_sha1 encode' , async ( ) => {
106
106
const h = new hashers . PBKDF2SHA1PasswordHasher ( ) ;
107
107
const hashPassword = await h . encode ( 'password' ) ;
108
108
const verify = await h . verify ( 'password' , hashPassword ) ;
109
- assert . equal ( verify , true , 'Testing pbkdf2_sha1 encode and verify from Django' ) ;
109
+ assert . strictEqual ( verify , true , 'Testing pbkdf2_sha1 encode and verify from Django' ) ;
110
110
} ) ;
111
111
112
112
it ( 'testing bcrypt_sha256 encode' , async ( ) => {
113
113
const h = new hashers . BCryptSHA256PasswordHasher ( ) ;
114
114
const hashPassword = await h . encode ( 'password' ) ;
115
115
const verify = await h . verify ( 'password' , hashPassword ) ;
116
- assert . equal ( verify , true , 'Testing bcrypt_sha256 encode and verify from Django' ) ;
116
+ assert . strictEqual ( verify , true , 'Testing bcrypt_sha256 encode and verify from Django' ) ;
117
117
} ) ;
118
118
119
119
it ( 'testing bcrypt encode' , async ( ) => {
120
120
const h = new hashers . BCryptPasswordHasher ( ) ;
121
121
const hashPassword = await h . encode ( 'password' ) ;
122
122
const verify = await h . verify ( 'password' , hashPassword ) ;
123
- assert . equal ( verify , true , 'Testing bcrypt encode and verify from Django' ) ;
123
+ assert . strictEqual ( verify , true , 'Testing bcrypt encode and verify from Django' ) ;
124
124
} ) ;
125
125
} ) ;
126
126
0 commit comments