Skip to content

Latest commit

 

History

History
55 lines (34 loc) · 1.02 KB

README.markdown

File metadata and controls

55 lines (34 loc) · 1.02 KB

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.