Skip to content

Commit 51277be

Browse files
committed
fixup! Add native entropy for iOS
1 parent b469710 commit 51277be

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

PhoenixCrypto/PhoenixCrypto/Classes/NativeWeakRandom.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ public class NativeWeakRandom: NSObject {
1414
private class func toByteArr(i: UInt64) -> [UInt8] {
1515
let count = MemoryLayout<UInt64>.size
1616
var _i = i
17-
let bytePtr = withUnsafePointer(to: &_i) {
18-
$0.withMemoryRebound(to: UInt8.self, capacity: count) {
19-
UnsafeBufferPointer(start: $0, count: count)
20-
}
17+
return withUnsafePointer(to: &_i) {
18+
$0.withMemoryRebound(to: UInt8.self, capacity: count) {
19+
[UInt8](UnsafeBufferPointer(start: $0, count: count))
20+
}
2121
}
22-
return [UInt8](bytePtr)
2322
}
2423

2524
@objc

0 commit comments

Comments
 (0)