Move previous cryptopals work into an Erlang subfolder, start cryptopals in Python 3
[sandbox] / cryptopals-erlang / 01.01 / hex.erl
1 -module(hex).
2 -export([decode/1]).
3
4 data_in_pairs([]) -> [];
5 data_in_pairs([C1,C2|Tail]) -> [ [C1] ++ [C2] | data_in_pairs(Tail) ].
6
7 decode(Data) -> << <<(list_to_integer(C,16)):8>> || C <- data_in_pairs(Data) >>.