CRC64ISODigest

OOP API CRC64-ISO implementation. See std.digest for differences between template and OOP API.

This is an alias for $(REF WrapperDigest, std,digest,digest)!CRC64ISO, see there for more information.

alias CRC64ISODigest = WrapperDigest!CRC64ISO

Examples

//Simple example, hashing a string using Digest.digest helper function
auto crc = new CRC32Digest();
ubyte[] hash = crc.digest("abc");
//Let's get a hash string
assert(crcHexString(hash) == "352441C2");
 //Let's use the OOP features:
void test(Digest dig)
{
  dig.put(cast(ubyte) 0);
}
auto crc = new CRC32Digest();
test(crc);

//Let's use a custom buffer:
ubyte[4] buf;
ubyte[] result = crc.finish(buf[]);
assert(crcHexString(result) == "D202EF8D");
//Simple example
auto hash = new CRC32Digest();
hash.put(cast(ubyte) 0);
ubyte[] result = hash.finish();
//using a supplied buffer
ubyte[4] buf;
auto hash = new CRC32Digest();
hash.put(cast(ubyte) 0);
ubyte[] result = hash.finish(buf[]);
//The result is now in result (and in buf. If you pass a buffer which is bigger than
//necessary, result will have the correct length, but buf will still have it's original
//length)

Meta

Suggestion Box / Bug Report