         if dataLength == 0 { return Data() }
 
         let capacity = estimateBase64Size(length: dataLength)
-        let ptr = UnsafeMutableRawPointer.allocate(byteCount: capacity, alignment: 1)
+        let ptr = UnsafeMutableRawPointer.allocate(byteCount: capacity, alignment: 4)
         let buffer = UnsafeMutableRawBufferPointer(start: ptr, count: capacity)
         let length = NSData.base64EncodeBytes(self, options: options, buffer: buffer)
 

        var separatorByte2: UInt8? = nil
        var index = 0

        let dataLength = data.length
        let dataBuffer = UnsafeRawBufferPointer(start: data.bytes, count: dataLength)
        var dataIndex = 0

        func nextByte() -> UInt8? {
            guard dataIndex < dataLength else { return nil }
            defer { dataIndex += 1 }
            return dataBuffer[dataIndex]
        }

        if options.isEmpty {
            lineLength = 0
            separatorByte1 = 0

        if dataLength == 0 { return "" }

        let capacity = estimateBase64Size(length: dataLength)
        let ptr = UnsafeMutableRawPointer.allocate(byteCount: capacity, alignment: 4)
        defer { ptr.deallocate() }
        let buffer = UnsafeMutableRawBufferPointer(start: ptr, count: capacity)
        let length = NSData.base64EncodeBytes(self, options: options, buffer: buffer)

        return String(decoding: UnsafeRawBufferPointer(start: ptr, count: length), as: Unicode.UTF8.self)
    }

    /// Creates a Base64, UTF-8 encoded Data from the data object using the given options.
