Skip to content

Commit 21f07e0

Browse files
committed
feat: Add Codable conformance to HashAlgorithm
Added Codable conformance to HashAlgorithm enum for compatibility with consuming packages that need to encode/decode hash algorithms. This is required for FileSystemKit's DiskImageHash which needs to be Codable. Changes: - HashAlgorithm: String, Sendable, CaseIterable → String, Codable, Sendable, CaseIterable - Version: 1.2.1 → 1.2.2 All 149 tests passing ✅
1 parent e4b9fa4 commit 21f07e0

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Sources/DesignAlgorithmsKit/DesignAlgorithmsKit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import Foundation
5151
/// - WASM (limited - excludes hash/crypto types that require NSLock)
5252
public struct DesignAlgorithmsKit {
5353
/// Library version
54-
public static let version = "1.2.1"
54+
public static let version = "1.2.2"
5555
}
5656

5757
// Re-export all modules

Sources/DesignAlgorithmsKit/HashComputation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import CommonCrypto
1515
#endif
1616

1717
/// Supported hash algorithms
18-
public enum HashAlgorithm: String, Sendable, CaseIterable {
18+
public enum HashAlgorithm: String, Codable, Sendable, CaseIterable {
1919
case sha256 = "sha256"
2020
case sha1 = "sha1"
2121
case md5 = "md5"

test_import.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import DesignAlgorithmsKit
2+
3+
print("Testing import...")
4+
print(type(of: HashComputation.self))

0 commit comments

Comments
 (0)