Hello there, new to this forum and not sure if this is the right section. Apologies if it isn't!
I'm currently trying to write a server-side Swift WebSockets backend using Vapor, and I'm trying to compress/decompress all my messages.
let compressedData = try Data(referencing: NSData(data: data).compressed(using: .lzfse))
compiles fine on Darwin, but gives this error when I compile on my Ubuntu server.
error: value of type 'NSData' has no member 'compressed'
The same occurs for NSData's decompressed method.
Any idea how I can get them to compile on Linux?
Swift version 5.3.3 (swift-5.3.3-RELEASE)
My swift on Darwin is:
Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1220.127.116.11)
I've also tried using
.zlib instead of
.lzfse, in hopes that something that is more cross-platform might fix the issue, but nope: the same issue still occurs.