You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8f04339
Browse filesBrowse the repository at this point in the historyBrowse files
Johan Brichau
committed
Expanded the testcase for secureHashFor: to also cover (any) bytearray as argument since this method is used in Seaside with any String or ByteArray
"Make sure the platform class provides a #secureHashFor: method. The method is called by Seaside when hashing passwords. The Squeak implementation returns a SHA-1 hash but another equivalent hash method could also be used."
3
+
"Make sure the platform class provides a #secureHashFor: method. The method is called by Seaside when hashing passwords.
4
+
The Pharo implementation returns a SHA-1 hash but another equivalent hash method could also be used."
4
5
5
-
| ab |
6
+
| abcdinvalidUtf8ef|
6
7
a :=self platform secureHashFor:'foobar'.
7
8
b :=self platform secureHashFor:'foobar'.
9
+
selfassert: a equals: b.
10
+
11
+
c :=self platform secureHashFor:#[102 111 111 98 97 114].
12
+
d :=self platform secureHashFor:#[102 111 111 98 97 114].
13
+
selfassert: c equals: d.
8
14
9
-
selfassert: (a = b)
15
+
"The following ensures any byte array can be used (and not only the onces containing valid utf8)"
0 commit comments