mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
Changed random seed generation for bitcoin.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import Foundation
|
||||
|
||||
func secRandom(count: Int) -> Data? {
|
||||
var bytes = [Int8](repeating: 0, count: count)
|
||||
let status = SecRandomCopyBytes(kSecRandomDefault, bytes.count, &bytes)
|
||||
|
||||
if status == errSecSuccess {
|
||||
return Data(bytes: bytes, count: bytes.count)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user