siphash

D implementation of SipHash.


Licenses
BSL-1.0/SSPL-1.0
Install
dub fetch siphash

Documentation

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.