Class: Stribog::CreateHash
- Inherits:
-
Object
- Object
- Stribog::CreateHash
- Defined in:
- lib/stribog/create_hash.rb
Overview
Hash function
Constant Summary collapse
- HASH_LENGTH =
512
Instance Attribute Summary collapse
-
#binary_vector ⇒ Object
readonly
Returns the value of attribute binary_vector.
-
#digest_length ⇒ Object
readonly
Returns the value of attribute digest_length.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#message_adapter ⇒ Object
readonly
Returns the value of attribute message_adapter.
-
#message_vector ⇒ Object
readonly
Returns the value of attribute message_vector.
Instance Method Summary collapse
- #call(digest_length = HASH_LENGTH) ⇒ Object
-
#initialize(message, binary_vector: BinaryVector) ⇒ CreateHash
constructor
A new instance of CreateHash.
Constructor Details
#initialize(message, binary_vector: BinaryVector) ⇒ CreateHash
Returns a new instance of CreateHash.
11 12 13 14 15 16 |
# File 'lib/stribog/create_hash.rb', line 11 def initialize(, binary_vector: BinaryVector) @binary_vector = binary_vector = binary_vector.from_hex() @n = binary_vector_field_by @sum = binary_vector_field_by end |
Instance Attribute Details
#binary_vector ⇒ Object (readonly)
Returns the value of attribute binary_vector.
7 8 9 |
# File 'lib/stribog/create_hash.rb', line 7 def binary_vector @binary_vector end |
#digest_length ⇒ Object (readonly)
Returns the value of attribute digest_length.
7 8 9 |
# File 'lib/stribog/create_hash.rb', line 7 def digest_length @digest_length end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/stribog/create_hash.rb', line 7 def end |
#message_adapter ⇒ Object (readonly)
Returns the value of attribute message_adapter.
7 8 9 |
# File 'lib/stribog/create_hash.rb', line 7 def end |
#message_vector ⇒ Object (readonly)
Returns the value of attribute message_vector.
7 8 9 |
# File 'lib/stribog/create_hash.rb', line 7 def end |
Instance Method Details
#call(digest_length = HASH_LENGTH) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/stribog/create_hash.rb', line 18 def call(digest_length = HASH_LENGTH) create_hash_params!(digest_length: digest_length) return_hash( final_compression( core_hashing( ( sum: @sum, n: @n, message_vector: , hash_vector: @hash_vector ) ) ) ) end |