Class: Digest::CRC32
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Digest_Base
|
|
|
Instance Chain:
self,
Digest_Base
|
|
| Inherits: |
Digest_Base
|
| Defined in: | ext/digest/crc32/crc32init.c, ext/digest/crc32/crc32init.c |
Overview
A class for calculating message digests using CRC32 algorithm.
CRC32 calculates a digest of 32 bits (4 bytes).
Examples
require 'digest'
Compute a complete digest
Digest::CRC32.hexdigest 'abc' #=> "8eb208f7..."
Compute digest by chunks
crc32 = Digest::CRC32.new # =>#Digest::CRC32 crc32.update "ab" crc32 << "c" # alias for #update crc32.hexdigest # => "352441c2"
Use the same object to compute another digest
crc32.reset crc32 << "message" crc32.hexdigest # => "b6bd307f"