A postblit is present on this object, but not explicitly documented in the source.
Incorporate element_count and finalizes the hash.
Incorporate element_count and finalizes the hash.
Incorporate element_count and finalizes the hash.
Finalizes the computation of the hash and returns the computed value. Note that finish can be called only once and that no subsequent calls to put is allowed.
Returns the hash as an uint value.
Returns the hash as an uint[4] value.
Returns the hash as an ulong[2] value.
Returns the current hashed value as an ubyte array.
Returns the current hashed value as an ubyte array.
Returns the current hashed value as an ubyte array.
Adds data to the digester. This function can be called many times in a row after start but before finish.
Adds a single Element of data without increasing element_count. Make sure to increase element_count by Element.sizeof for each call to putElement.
Adds a single Element of data without increasing element_count. Make sure to increase element_count by Element.sizeof for each call to putElement.
Adds a single Element of data without increasing element_count. Make sure to increase element_count by Element.sizeof for each call to putElement.
Pushes an array of elements at once. It is more efficient to push as much data as possible in a single call. On platforms that do not support unaligned reads (MIPS or old ARM chips), the compiler may produce slower code to ensure correctness.
Put remainder bytes. This must be called only once after putElement and before finalize.
Put remainder bytes. This must be called only once after putElement and before finalize.
Put remainder bytes. This must be called only once after putElement and before finalize.
The convenient digest template allows for quick hashing of any data.
ubyte[4] hashed = digest!(MurmurHash3!32)([1, 2, 3, 4]); assert(hashed == [0, 173, 69, 68]);
One can also hash ubyte data piecewise by instanciating a hasher and call the 'put' method.
const(ubyte)[] data1 = [1, 2, 3]; const(ubyte)[] data2 = [4, 5, 6, 7]; // The incoming data will be buffered and hashed element by element. MurmurHash3!32 hasher; hasher.put(data1); hasher.put(data2); // The call to 'finish' ensures: // - the remaining bits are processed // - the hash gets finalized auto hashed = hasher.finish(); assert(hashed == [181, 151, 88, 252]);
Implements the MurmurHash3 functions. You can specify the size of the hash in bit. For 128 bit hashes you can specify whether to optimize for 32 or 64 bit architectures. If you don't specify the opt value it will select the fastest version of the host platform.
This hasher is compatible with the Digest API:
It also provides a faster, low level API working with data of size Element.sizeof: