We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b469710 commit 51277beCopy full SHA for 51277be
PhoenixCrypto/PhoenixCrypto/Classes/NativeWeakRandom.swift
@@ -14,12 +14,11 @@ public class NativeWeakRandom: NSObject {
14
private class func toByteArr(i: UInt64) -> [UInt8] {
15
let count = MemoryLayout<UInt64>.size
16
var _i = i
17
- let bytePtr = withUnsafePointer(to: &_i) {
18
- $0.withMemoryRebound(to: UInt8.self, capacity: count) {
19
- UnsafeBufferPointer(start: $0, count: count)
20
- }
+ return withUnsafePointer(to: &_i) {
+ $0.withMemoryRebound(to: UInt8.self, capacity: count) {
+ [UInt8](UnsafeBufferPointer(start: $0, count: count))
+ }
21
}
22
- return [UInt8](bytePtr)
23
24
25
@objc
0 commit comments