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.
My code
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?
Ubuntu 18.04
Swift version 5.3.3 (swift-5.3.3-RELEASE)
Target: x86_64-unknown-linux-gnu
My swift on Darwin is:
Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
Target: x86_64-apple-darwin20.2.0
EDIT:
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.