Refactoring

This commit is contained in:
Ali
2021-09-07 13:09:06 +04:00
parent f0f02dc4b9
commit 1141e09c1b
257 changed files with 1894 additions and 1720 deletions

View File

@@ -25,7 +25,9 @@ public func generateSecureIdValueAccessContext() -> SecureIdValueAccessContext?
}
let secretHashData = sha512Digest(secret)
var secretHash: Int64 = 0
secretHashData.withUnsafeBytes { (bytes: UnsafePointer<Int8>) -> Void in
secretHashData.withUnsafeBytes { rawBytes -> Void in
let bytes = rawBytes.baseAddress!.assumingMemoryBound(to: Int8.self)
memcpy(&secretHash, bytes.advanced(by: secretHashData.count - 8), 8)
}
return SecureIdValueAccessContext(secret: secret, id: secretHash)