Class: Digest::CRC32
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize ⇒ CRC32
constructor
A new instance of CRC32.
- #reset ⇒ Object
- #update(str) ⇒ Object
Constructor Details
#initialize ⇒ CRC32
Returns a new instance of CRC32.
7 8 9 |
# File 'lib/crc32.rb', line 7 def initialize reset end |
Instance Method Details
#finish ⇒ Object
19 20 21 |
# File 'lib/crc32.rb', line 19 def finish [@crc32].pack("N") end |
#reset ⇒ Object
11 12 13 |
# File 'lib/crc32.rb', line 11 def reset @crc32 = 0 end |
#update(str) ⇒ Object
15 16 17 |
# File 'lib/crc32.rb', line 15 def update(str) @crc32 = Zlib.crc32(str, @crc32) end |