 
 // MARK: - Utils
 
-private func xor(_ a: Array<UInt8>, _ b: Array<UInt8>) -> Array<UInt8> {
+fileprivate func xor(_ a: Array<UInt8>, _ b: Array<UInt8>) -> Array<UInt8> {
     var xored = Array<UInt8>(repeating: 0, count: min(a.count, b.count))
     for i in 0..<xored.count {
         xored[i] = a[i] ^ b[i]

    }
    #else
    func toInteger<T: Integer>() -> T where T: ByteConvertible, T: BitshiftOperationsType {
    if self.isEmpty {
    return 0
    }

    var bytes = self.reversed()
    if bytes.count < MemoryLayout<T>.size {
    let paddingCount = MemoryLayout<T>.size - bytes.count
    if paddingCount > 0 {
    bytes += Array<UInt8>(repeating: 0, count: paddingCount)
    }
    }

    if MemoryLayout<T>.size == 1 {
    return T(truncatingBitPattern: UInt64(bytes[0]))
    }

    var result: T = 0
    for byte in bytes.reversed() {
    result = result << 8 | T(byte)
    }
    return result
    }
    #endif
}


    /// returns optional decrypted string via AES-256CBC
    /// IV need to be at first 16 chars, password must be 32 chars long
    class func decryptString(_ str: String, password: String) -> String? {
        if str.characters.count > 16 && password.characters.count == 32 {
            // get AES initialization vector from first 16 chars
            let iv = str.substring(to: str.index(str.startIndex, offsetBy: 16))
