             _ = queue.sync {
                 fgets(data, Int32(capacity), file)
             }
+    
             return Array(UnsafeMutableBufferPointer(start: data, count: count))
         }
-    }
-#endif
+    #else
+        /// Get a random number of a given capacity.
+        ///
+        /// - Parameter count: Byte count.
+        /// - Returns: Return the random number.
+        static func get(count: Int) -> [UInt8] {
+            let capacity = count + 1
+            var data = UnsafeMutablePointer<UInt8>.allocate(capacity: capacity)
+            var secure: Int32 = 0
+            defer {
+                data.deallocate(capacity: capacity)
+            }
+            _ = queue.sync {
+                secure = SecRandomCopyBytes(kSecRandomDefault, capacity, data)
+            }
+            
+            return secure == 0 ? Array(UnsafeMutableBufferPointer(start: data, count: count)) : [0]
+        }
+    #endif
+}
 
 // MARK: - Extensions
 
-#if os(Linux)
-    /// This extension adds some useful function to Integer.
-    public extension Integer {
-        /// Creates a random integer number.
-        ///
-        /// - Returns: Returns the creates a random integer number.
-        static func random() -> Self {
-            let numbers = Randomizer.get(count: MemoryLayout<Self>.size)
-            return numbers.withUnsafeBufferPointer { bufferPointer in
-                return bufferPointer.baseAddress!.withMemoryRebound(to: Self.self, capacity: 1) {
-                    return $0.pointee
-                }
+/// This extension adds some useful function to Integer.
+public extension Integer {
+    /// Creates a random integer number.
+    ///
+    /// - Returns: Returns the creates a random integer number.
+    static func random() -> Self {
+        let numbers = Randomizer.get(count: MemoryLayout<Self>.size)
+        return numbers.withUnsafeBufferPointer { bufferPointer in
+            return bufferPointer.baseAddress!.withMemoryRebound(to: Self.self, capacity: 1) {
+                return $0.pointee
             }
         }
     }
-#endif
+}
 
 /// This extesion adds some useful functions to Double.
 public extension Double {

///   - maxValue: Maxinum random value. Default is 1.
/// - Returns: Returns the created random float.
public func randomFloat(min minValue: Float = 0, max maxValue: Float = 1) -> Float {
    #if os(Linux)
        let random = abs(Float.random())
    #else
        let random = Float(arc4random()) / Float(UINT32_MAX)
    #endif
    return random * abs(minValue - maxValue) + min(minValue, maxValue)
}

// MARK: - Randomizer struct

#if os(Linux)
    /// Produces great cryptographically random numbers.
    private struct Randomizer {
        /// /dev/urandom file.
        static let file = fopen("/dev/urandom", "r")!
        /// Random queue.
        static let queue = DispatchQueue(label: "random")
        
        /// Get a random number of a given capacity.
        ///
        /// - Parameter count: Byte count.

/// Create a random integer between the given range.
///
/// - Parameters:
///   - minValue: Mininum random value. Default is 0.
///   - maxValue: Maxinum random value. Default is 1.
/// - Returns: Returns the created random integer.
public func randomInt(min minValue: Int = 0, max maxValue: Int = 100) -> Int {
    return randomInt(range: minValue...maxValue)
}

