杨锴
2024-08-14 909e20941e45f8712c012db602034b47da0bfdb0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// DigestExtensions.swift - Copyright 2024 SwifterSwift
 
#if canImport(CryptoKit)
import CryptoKit
 
@available(iOS 13.0, macOS 10.15, watchOS 6.0, tvOS 13.0, *)
public extension Digest {
    // MARK: - Properties
 
    /// SwifterSwift: Hexadecimal value string (read-only, Complexity: O(N), _N_ being the amount of bytes.)
    var hexString: String {
        var result = ""
        for byte in makeIterator() {
            result += String(format: "%02X", byte)
        }
        return result
    }
}
#endif