Skip to content

Instantly share code, notes, and snippets.

@argv0
Created July 22, 2013 19:38
Show Gist options
  • Save argv0/6056930 to your computer and use it in GitHub Desktop.
Save argv0/6056930 to your computer and use it in GitHub Desktop.
simple_test() ->
{ok, EC} = erasuerl:new(),
{ok, Bin} = file:read_file("/usr/share/dict/words"),
{MD, KBins, MBins} = erasuerl:encode(EC, Bin),
[K1, K2, K3, K4, K5, K6, K7, K8, K9] = KBins,
[M1, M2, M3, M4] = MBins,
KBins2 = [undefined, undefined, undefined, K4, K5, K6, K7, K8, K9],
MBins2 = [undefined, M2, M3, M4],
Bin = iolist_to_binary(erasuerl:decode(EC, MD, KBins2, MBins2)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment