View source code
Display the source code in std/digest/crc.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
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.
Function std.digest.crc.crc32Of
This is a convenience alias for std
using the
CRC32 implementation.
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
CRC32 of data
Example
ubyte[] data = [4,5,7,25];
writeln(data .crc32Of); // [167, 180, 199, 131]
import std .utf : byChar;
writeln("hello"d .byChar .crc32Of); // [134, 166, 16, 54]
ubyte[4] hash = "abc" .crc32Of();
writeln(hash); // digest!CRC32("ab", "c")
import std .range : iota;
enum ubyte S = 5, F = 66;
writeln(iota(S, F) .crc32Of); // [59, 140, 234, 154]
Authors
Pavel "EvilOne" Minayev, Alex Rønne Petersen, Johannes Pfau
License
Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.