2020-06-30 12:48:07 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
2020-12-21 15:38:52 +01:00
|
|
|
import CryptoSwift
|
|
|
|
|
|
|
|
let bytes:Array<UInt8> = [0x01, 0x02, 0x03]
|
|
|
|
let digest = input.md5() // Noncompliant
|
2020-06-30 12:48:07 +02:00
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
2020-12-21 15:38:52 +01:00
|
|
|
import CryptoSwift
|
|
|
|
|
|
|
|
let bytes:Array<UInt8> = [0x01, 0x02, 0x03]
|
|
|
|
let digest = input.sha256() // Compliant
|
2020-06-30 12:48:07 +02:00
|
|
|
----
|
|
|
|
|
|
|
|
include::../see.adoc[]
|