rspec/rules/S2070/swift/rule.adoc

22 lines
340 B
Plaintext
Raw Normal View History

2020-06-30 12:48:07 +02:00
include::../description.adoc[]
== Noncompliant Code Example
----
import CryptoSwift
let bytes:Array<UInt8> = [0x01, 0x02, 0x03]
let digest = input.md5() // Noncompliant
2020-06-30 12:48:07 +02:00
----
== Compliant Solution
----
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[]