Skip to content
/ cdb Public

erlang implementation of the constant databse (cdb) by Daniel J. Bernstein.

License

Notifications You must be signed in to change notification settings

laktech/cdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cdb

An implementation of cdb written in erlang. The binary format is compatible with D. J. Bernstein cdb as well as tinycdb.

Build

    $ rebar3 compile

Create a cdb

    A = cdb:make_start("foo.cdb"),
    B = cdb:make_add(A, <<199919:64>>, <<"ccc">>),
    C = cdb:make_add(B, <<"aa">>, <<"bbb">>),
    ok = cdb:make_finish(C),
    ?assertEqual({<<199919:64>>, <<"ccc">>}, cdb:find("foo.cdb", <<199919:64>>)),
    ?assertEqual({<<"aa">>, <<"bbb">>}, cdb:find("foo.cdb", <<"aa">>)).

Find a key

    A = cdb:make_start("foo.cdb"),
    B = cdb:make_add(A, <<"aa">>, <<"bbb">>),
    ok = cdb:make_finish(B),
    ?assertEqual({<<"aa">>, <<"bbb">>}, cdb:find("foo.cdb", <<"aa">>)).

About

erlang implementation of the constant databse (cdb) by Daniel J. Bernstein.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages