Human Talks Paris, 2013-02-12
[1] You have been warned...
~ 100kB core + 100kB stdlib, 4kB RAM
1 64 bits core, may 2010 :(
local ffi = require("ffi")
ffi.cdef[[
unsigned long compressBound(unsigned long sourceLen);
int compress2(uint8_t *dest, unsigned long *destLen,
const uint8_t *source, unsigned long sourceLen, int level);
]]
local zlib = ffi.load("z")
local compress = function(txt)
local n = zlib.compressBound(#txt)
local buf = ffi.new("uint8_t[?]", n)
local buflen = ffi.new("unsigned long[1]", n)
assert(zlib.compress2(buf, buflen, txt, #txt, 9) == 0)
return ffi.string(buf, buflen[0])
end
local txt = string.rep("abcd", 1000)
local c = compress(txt)
Angry Birds, Cry Engine 2 (Crysis), World of Warcraft, L.A. Noire, Baldur's Gate, Heroes of Might & Magic V...
VLC, Adobe Lightroom, Awesome WM (Kindle Touch), Redis, Luvit / LUV, nginx, nmap, wireshark, SnabbSwitch, NetBSD, Codea, Roblox...