Class: LZMA::Utils::CRC64
- Inherits:
-
Struct
- Object
- Struct
- LZMA::Utils::CRC64
- Defined in:
- lib/extlzma2/utils.rb
Instance Attribute Summary collapse
-
#init ⇒ Object
Returns the value of attribute init.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
- #digest ⇒ Object
- #finish ⇒ Object
- #hexdigest ⇒ Object (also: #to_s)
-
#initialize(state = 0) ⇒ CRC64
constructor
A new instance of CRC64.
- #reset ⇒ Object
- #to_str ⇒ Object (also: #inspect)
- #update(data) ⇒ Object (also: #<<)
Constructor Details
#initialize(state = 0) ⇒ CRC64
Returns a new instance of CRC64.
61 62 63 64 |
# File 'lib/extlzma2/utils.rb', line 61 def initialize(state = 0) state = state.to_i super(state, state) end |
Instance Attribute Details
#init ⇒ Object
Returns the value of attribute init
60 61 62 |
# File 'lib/extlzma2/utils.rb', line 60 def init @init end |
#state ⇒ Object
Returns the value of attribute state
60 61 62 |
# File 'lib/extlzma2/utils.rb', line 60 def state @state end |
Instance Method Details
#digest ⇒ Object
82 83 84 |
# File 'lib/extlzma2/utils.rb', line 82 def digest [state].pack('Q>') end |
#finish ⇒ Object
73 74 75 |
# File 'lib/extlzma2/utils.rb', line 73 def finish self end |
#hexdigest ⇒ Object Also known as: to_s
86 87 88 |
# File 'lib/extlzma2/utils.rb', line 86 def hexdigest '%016x' % state end |
#reset ⇒ Object
77 78 79 80 |
# File 'lib/extlzma2/utils.rb', line 77 def reset self.state = init self end |
#to_str ⇒ Object Also known as: inspect
92 93 94 |
# File 'lib/extlzma2/utils.rb', line 92 def to_str "CRC64 <#{hexdigest}>" end |