Extract Digest extension to separate file
This commit is contained in:
parent
b47c551160
commit
763b90f689
13
Sources/Generator/Extensions/Digest+Extension.swift
Normal file
13
Sources/Generator/Extensions/Digest+Extension.swift
Normal 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()
|
||||
}
|
||||
}
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user