crc32Of

This is a convenience alias for std.digest.digest using the CRC32 implementation.

ubyte[4]
crc32Of
(
T...
)
()

Parameters

data T

InputRange of ElementType implicitly convertible to ubyte, ubyte[] or ubyte[num] or one or more arrays of any type.

Return Value

Type: ubyte[4]

CRC32 of data

Examples

ubyte[] data = [4,5,7,25];
assert(data.crc32Of == [167, 180, 199, 131]);

import std.utf : byChar;
assert("hello"d.byChar.crc32Of == [134, 166, 16, 54]);

ubyte[4] hash = "abc".crc32Of();
assert(hash == digest!CRC32("ab", "c"));

import std.range : iota;
enum ubyte S = 5, F = 66;
assert(iota(S, F).crc32Of == [59, 140, 234, 154]);

Meta