CHGenerator/Sources/Generator/Extensions/Digest+Extension.swift

14 lines
233 B
Swift
Raw Normal View History

import Foundation
import CryptoKit
extension Digest {
var bytes: [UInt8] { Array(makeIterator()) }
var data: Data { Data(bytes) }
var hexStr: String {
bytes.map { String(format: "%02X", $0) }.joined()
}
}