Skip to content

Commit

Permalink
Make sure CRC#checksum return an XORed checksum.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed May 29, 2010
1 parent b1154e1 commit 03538a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/digest/crc.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'digest'

module Digest
class CRC
class CRC < Digest::Class

include Digest::Instance

Expand Down Expand Up @@ -36,15 +36,15 @@ def reset
end

def checksum
@crc
@crc ^ self.class.const_get(:XOR_CRC)
end

def self.pack(crc)
''
end

def finish
self.class.pack(@crc ^ self.class.const_get(:XOR_CRC))
self.class.pack(checksum)
end

end
Expand Down

0 comments on commit 03538a8

Please sign in to comment.