         let X = sqrt(-2*log(A))*cos(2*Float(M_PI)*B)
         return X*sigma + mu
     }
-}+}

    /// Initialize the internal state of the generator.
    ///
    /// - parameter seed: The value used to generate the intial state. Should be chosen at random.
    public static func seed(seed: UInt32) {
        Squall.generator = MersenneTwisterGenerator(seed: seed)
    }
    

        // Finding a contiguous stretch of memory much longer than this might not be possible, especially on iOS
        precondition(length < 10485760, "Buffer would exceed 10mb")
        
        let rawMemory = UnsafeMutablePointer<Void>.allocatingCapacity(length)
        // guard rawMemory != nil else { return nil }
        let buffer = UnsafeMutablePointer<UInt8>(rawMemory)
        
        let numChunks = length / 4
        for index in 0..<numChunks {
            let chunk = Squall.random() as UInt32
            (buffer + (index * 4)).pointee     = UInt8((chunk & 0xFF000000) >> 24)
            (buffer + (index * 4) + 1).pointee = UInt8((chunk & 0x00FF0000) >> 16)
            (buffer + (index * 4) + 2).pointee = UInt8((chunk & 0x0000FF00) >> 8)
            (buffer + (index * 4) + 3).pointee = UInt8((chunk & 0x000000FF))
        }
        
        var numExtra = length % 4
        let extraChunk = Squall.random() as UInt32
        while numExtra > 0 {
            let shift = UInt32(numExtra * 8)
            let mask: UInt32 = 0xFF << shift
            (buffer + (numChunks * 4) + numExtra).pointee = UInt8((extraChunk & mask) >> shift)
            numExtra -= 1
        }
        
