Class: Xmldsign::Digests::Gost
- Inherits:
-
Object
- Object
- Xmldsign::Digests::Gost
- Defined in:
- lib/xmldsign/digests/gost.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #base64 ⇒ Object
- #hex ⇒ Object
-
#initialize(data) ⇒ Gost
constructor
A new instance of Gost.
Constructor Details
#initialize(data) ⇒ Gost
Returns a new instance of Gost.
9 10 11 |
# File 'lib/xmldsign/digests/gost.rb', line 9 def initialize(data) @data = data.to_s end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/xmldsign/digests/gost.rb', line 7 def data @data end |
Class Method Details
.base64(data) ⇒ Object
23 24 25 |
# File 'lib/xmldsign/digests/gost.rb', line 23 def base64(data) new(data).base64 end |
.hex(data) ⇒ Object
27 28 29 |
# File 'lib/xmldsign/digests/gost.rb', line 27 def hex(data) new(data).hex end |
Instance Method Details
#base64 ⇒ Object
13 14 15 |
# File 'lib/xmldsign/digests/gost.rb', line 13 def base64 [[hex].pack('H*')].pack('m0') end |
#hex ⇒ Object
17 18 19 |
# File 'lib/xmldsign/digests/gost.rb', line 17 def hex Anyhash.gost_cryptopro(data) end |