View source code
Display the source code in std/digest/crc.d from which this page was generated on
github.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Page wiki
View or edit the community-maintained wiki page associated with this page.
Function std.digest.crc.crc32Of
This is a convenience alias for std.digest.digest.digest
using the
CRC32
implementation.
Prototype
ubyte[4] crc32Of(T...)( T data );
Parameters
Name | Description |
---|---|
data | InputRange of ElementType implicitly convertible to
ubyte , ubyte[] or ubyte[num] or one or more arrays
of any type. |
Returns
Example
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]);
Authors
Pavel "EvilOne" Minayev, Alex Rønne Petersen, Johannes Pfau