
Improvement identified in #2790. Add a prefix to the diff-id when it is used multiple times in different "how to fix it in XYZ" sections to avoid ambiguity and pedantically follow the spec: > A single and unique diff-id should be used only once for each type of code example as shown in the description of a rule.
29 lines
479 B
Plaintext
29 lines
479 B
Plaintext
== How to fix it in IDZSwiftCommonCrypto
|
|
|
|
=== Code examples
|
|
|
|
include::../../common/fix/code-rationale.adoc[]
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,swift,diff-id=31,diff-type=noncompliant]
|
|
----
|
|
import IDZSwiftCommonCrypto
|
|
|
|
let algorithm = .des // Noncompliant
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,swift,diff-id=31,diff-type=compliant]
|
|
----
|
|
import IDZSwiftCommonCrypto
|
|
|
|
let algorithm = .aes
|
|
----
|
|
|
|
=== How does this work?
|
|
|
|
include::../../common/fix/strong-cryptography.adoc[]
|
|
|