Extract Digest extension to separate file

This commit is contained in:
Christoph Hagen 2022-09-18 16:45:34 +02:00
parent b47c551160
commit 763b90f689
2 changed files with 13 additions and 11 deletions

View File

@ -0,0 +1,13 @@
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()
}
}

View File

@ -632,14 +632,3 @@ final class FileSystem {
return output
}
}
private extension Digest {
var bytes: [UInt8] { Array(makeIterator()) }
var data: Data { Data(bytes) }
var hexStr: String {
bytes.map { String(format: "%02X", $0) }.joined()
}
}