Skip to content

Instantly share code, notes, and snippets.

@yannick
Created July 22, 2015 13:55
Show Gist options
  • Select an option

  • Save yannick/0d48dc1411be9d7050bd to your computer and use it in GitHub Desktop.

Select an option

Save yannick/0d48dc1411be9d7050bd to your computer and use it in GitHub Desktop.
import std.stdio;
import std.string;
import std.zlib;
void main(){
string bla = "VERYLONGSTRING";
auto compressed = std.zlib.compress(cast(void[]) cast(ubyte[])bla);
writeln(compressed);
writeln(compressed.length);
writeln("----");
auto uncomp = cast(string)std.zlib.uncompress(cast(void[])compressed);
writeln(uncomp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment