styx2000.extrautil.siphash

This class provides an implementation of the SipHash cryptographic function. Implementation is based on the following code (by Károly Lőrentey): https://github.com/attaswift/SipHash/blob/master/SipHash/SipHasher.swift

Members

Aliases

asHexBE
alias asHexBE = asHexWithOrder!(BYTE_ORDER.BIG_ENDIAN)

Create string representation of some value in hexadecimal view with big_endian order of digits.

asHexLE
alias asHexLE = asHexWithOrder!(BYTE_ORDER.LITTLE_ENDIAN)

Create string representation of some value in hexadecimal view with little_endian order of digits.

Classes

SipHash
class SipHash(ubyte NUMBER_OF_COMPRESS_ROUNDS = 2, ubyte NUMBER_OF_FINALIZATION_ROUNDS = 4)

The class provides functionality to initialize the internal state of the SipHash hash function and generate a hash for byte arrays.

Enums

BYTE_ORDER (from styx2000.lowlevel.endianness)
enum BYTE_ORDER via public import styx2000.lowlevel.endianness : BYTE_ORDER;

Endianess (i.e byte-order)

Functions

hash
auto hash(ubyte[] bytes, ubyte[] key)

Hashes a byte stream with the specified cryptographic key.

hash8
auto hash8(ubyte[] bytes, ulong[2] key)

Hashes a byte stream with the specified cryptographic key.

hash8
auto hash8(string s, ulong[2] key)

Hashes a string with the specified cryptographic key.

Templates

asHexWithOrder
template asHexWithOrder(BYTE_ORDER byteOrder)

Create string representation of some value in hexadecimal view with specified byte order.

Meta