mirror of
https://github.com/apple/swift-crypto
synced 2026-11-22 04:30:39 +00:00
Fix WASI platform build issue (#291)
This commit is contained in:
1 file changed
+3
-3
@@ -21,9 +21,6 @@ extension UnsafeMutableRawBufferPointer {
|
||||
|
||||
#if canImport(Darwin) || os(Linux) || os(Android) || os(Windows)
|
||||
var rng = SystemRandomNumberGenerator()
|
||||
#else
|
||||
fatalError("No secure random number generator on this platform.")
|
||||
#endif
|
||||
precondition(count <= self.count)
|
||||
|
||||
// We store bytes 64-bits at a time until we can't anymore.
|
||||
@@ -41,6 +38,9 @@ extension UnsafeMutableRawBufferPointer {
|
||||
remainingWord >>= 8
|
||||
targetPtr = UnsafeMutableRawBufferPointer(rebasing: targetPtr[1...])
|
||||
}
|
||||
#else
|
||||
fatalError("No secure random number generator on this platform.")
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user