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
Copy file name to clipboardExpand all lines: README.playground/Contents.swift
+10-8Lines changed: 10 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,8 @@ import IDZSwiftCommonCrypto
20
20
Using `Digest`
21
21
--------------
22
22
23
+
* Note: The code below uses MD5 for demonstration purposes because it generates short digests, however, it is considered cryptographically broken and new code should use at least SHA256.
24
+
23
25
To calculate a message digest you create an instance of `Digest`, call `update` one or more times with the data over which the digest is being calculated and finally call `final` to obtain the digest itself.
24
26
25
27
The `update` method can take a `String`
@@ -63,11 +65,11 @@ var digests4 = Digest(algorithm: .md5).update(s)?.final() // digest is of type [
63
65
### Supported Algorithms
64
66
The `Digest` class supports the following algorithms:
65
67
66
-
* `.md2`
67
-
* `.md4`
68
-
* `.md5`
69
-
* `.sha1`
70
-
* `.sha224`
68
+
* `.md2` -- insecure and should not be used in new code.
69
+
* `.md4` -- insecure and should not be used in new code.
70
+
* `.md5` -- insecure and should not be used in new code.
71
+
* `.sha1` -- insecure and should not be used in new code.
72
+
* `.sha224` -- insecure and should not be used in new code.
0 commit comments