Unify SHA256 hash and hex usages (#687)

This commit is contained in:
Islam
2025-09-30 12:47:16 +02:00
committed by GitHub
parent f5af00be88
commit 78fb3f1bf6
14 changed files with 50 additions and 82 deletions
+1 -4
View File
@@ -521,10 +521,7 @@ struct NostrEvent: Codable {
] as [Any]
let data = try JSONSerialization.data(withJSONObject: serialized, options: [.withoutEscapingSlashes])
let hash = CryptoKit.SHA256.hash(data: data)
let hashData = Data(hash)
let hashHex = hash.compactMap { String(format: "%02x", $0) }.joined()
return (hashHex, hashData)
return (data.sha256Fingerprint(), data.sha256Hash())
}
func jsonString() throws -> String {