From 763b90f689b41b13b3e9ecdefc1240f6728d3b10 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Sun, 18 Sep 2022 16:45:34 +0200 Subject: [PATCH] Extract Digest extension to separate file --- Sources/Generator/Extensions/Digest+Extension.swift | 13 +++++++++++++ Sources/Generator/Files/FileSystem.swift | 11 ----------- 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 Sources/Generator/Extensions/Digest+Extension.swift diff --git a/Sources/Generator/Extensions/Digest+Extension.swift b/Sources/Generator/Extensions/Digest+Extension.swift new file mode 100644 index 0000000..552686c --- /dev/null +++ b/Sources/Generator/Extensions/Digest+Extension.swift @@ -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() + } +} diff --git a/Sources/Generator/Files/FileSystem.swift b/Sources/Generator/Files/FileSystem.swift index a9893ca..3a2656e 100644 --- a/Sources/Generator/Files/FileSystem.swift +++ b/Sources/Generator/Files/FileSystem.swift @@ -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() - } -}