We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey there - anyone had any luck compressing a site with Swift? I've tried this, but the result is different than if I do it on the command line
let raw : Data! = String("hello world").data(using: .utf8) let compressed2 = try! (raw as NSData).compressed(using: .lzma) print("https://itty.bitty.site/#/" + compressed2.base64EncodedString(options: []))
It outputs
https://itty.bitty.site/#//Td6WFoAAAD/EtlBAgAhARYAAAB0L+WjAQAKaGVsbG8gd29ybGQAAAABGws5p2IeBnKeegEAAAAAAFla
But it should be
https://itty.bitty.site/#/XQAAQAD//////////wA0GUnujekXiTozYAX3z2T/+3ggAA==
The text was updated successfully, but these errors were encountered:
The weird thing is that it works in the other direction
let encoded = "XQAAAAT//////////wA0GUnujekXiTozYAX3z2T/+3ggAA==" let uncData = try! NSData(base64Encoded: encoded, options: .ignoreUnknownCharacters)! .decompressed(using: .lzma) String(data: uncData as Data, encoding: .utf8) // prints hello world
Sorry, something went wrong.
No branches or pull requests
Hey there - anyone had any luck compressing a site with Swift? I've tried this, but the result is different than if I do it on the command line
It outputs
https://itty.bitty.site/#//Td6WFoAAAD/EtlBAgAhARYAAAB0L+WjAQAKaGVsbG8gd29ybGQAAAABGws5p2IeBnKeegEAAAAAAFla
But it should be
https://itty.bitty.site/#/XQAAQAD//////////wA0GUnujekXiTozYAX3z2T/+3ggAA==
The text was updated successfully, but these errors were encountered: