D implementation of SipHash
D Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.travis.yml
LICENSE_1_0.txt
README.markdown
package.json
posix.mak

README.markdown

Build Status

siphash-d

D implementation of SipHash.

Install

shiphash-d is only one file. Please copy src/siphash.d onto your project.

Usage

siphash24Of function.

siphash24Of is pre-defined function.

import siphash;

ubyte[16] k = cast(ubyte[])"To be|not to be!";
ubyte[] msg = cast(ubyte[])"that is the question.";
auto hashed = siphash24Of(k, msg);

You can use siphash template for other SipRound pair.

alias siphash!(1, 2).siphashOf siphash12Of;

SipHash object

SipHash provides std.digest like API.

import siphash;

ubyte[16] key = cast(ubyte[])"To be|not to be!";
auto sh = SipHash!(2, 4)(key);
sh.start();
sh.put(cast(ubyte[])"that is the question.");
auto hashed = sh.finish();

Link

Copyright

Copyright (c) 2012- Masahiro Nakagawa

Distributed under the Boost Software License, Version 1.0.