Compare commits
1 Commits
profile_co
...
tyiu/fix-w
| Author | SHA1 | Date | |
|---|---|---|---|
|
387d1f501b
|
@@ -448,7 +448,7 @@ func hex_encode(_ data: Data) -> String {
|
|||||||
func random_bytes(count: Int) -> Data {
|
func random_bytes(count: Int) -> Data {
|
||||||
var data = Data(count: count)
|
var data = Data(count: count)
|
||||||
_ = data.withUnsafeMutableBytes { mutableBytes in
|
_ = data.withUnsafeMutableBytes { mutableBytes in
|
||||||
SecRandomCopyBytes(kSecRandomDefault, count, mutableBytes)
|
SecRandomCopyBytes(kSecRandomDefault, count, mutableBytes.baseAddress!)
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user