Skip to content

Instantly share code, notes, and snippets.

View puzza007's full-sized avatar
πŸ’­
πŸ’…

Paul Oliver puzza007

πŸ’­
πŸ’…
View GitHub Profile
%%
%% Simple pool for gen_servers that only use :call
%%
-module(gen_server_call_pool).
-behaviour(gen_server).
%% --------------------------------------------------------------------
%% External exports
-export([start_link/3, stats/1]).
@puzza007
puzza007 / bf_test.erl
Created October 13, 2009 15:26
Test module for crypto blowfish functions
-module(bf_test).
%% Test vectors from http://www.schneier.com/code/vectors.txt
%% I've used this on the command-line
-export([to_bin/1]).
-include_lib("eunit/include/eunit.hrl").
-define(KEY, to_bin("0123456789ABCDEFF0E1D2C3B4A59687")).
puzza@MacBook:~/src/mochiweb-read-only/ebin$ erl
Erlang R13B02 (erts-5.7.3) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.3 (abort with ^G)
1> mochihex:to_bin("FEDCBA9876543210").
<<254,220,186,152,118,84,50,16>>
2> mochihex:to_hex(mochihex:to_bin("FEDCBA9876543210")).
"fedcba9876543210"
3> mochihex:to_bin("37363534333231204E6F77206973207468652074696D6520666F722000").
<<55,54,53,52,51,50,49,32,78,111,119,32,105,115,32,116,