Replace deprecated Data.withUnsafeMutableBytes call

This commit is contained in:
2023-01-02 00:06:52 -05:00
parent 202f6b1fb9
commit 387d1f501b

View File

@@ -448,7 +448,7 @@ func hex_encode(_ data: Data) -> String {
func random_bytes(count: Int) -> Data {
var data = Data(count: count)
_ = data.withUnsafeMutableBytes { mutableBytes in
SecRandomCopyBytes(kSecRandomDefault, count, mutableBytes)
SecRandomCopyBytes(kSecRandomDefault, count, mutableBytes.baseAddress!)
}
return data
}