Class: Blake2::Key
- Inherits:
-
Object
- Object
- Blake2::Key
- Defined in:
- lib/blake2/key.rb
Class Method Summary collapse
Instance Method Summary collapse
- #bytes ⇒ Object
-
#initialize(bytes) ⇒ Key
constructor
A new instance of Key.
Constructor Details
#initialize(bytes) ⇒ Key
Returns a new instance of Key.
7 8 9 |
# File 'lib/blake2/key.rb', line 7 def initialize(bytes) @bytes = bytes end |
Class Method Details
.from_hex(hex_str) ⇒ Object
15 16 17 |
# File 'lib/blake2/key.rb', line 15 def self.from_hex(hex_str) new([hex_str].pack("H*").bytes) end |
.from_string(str) ⇒ Object
11 12 13 |
# File 'lib/blake2/key.rb', line 11 def self.from_string(str) new(str.bytes) end |
.none ⇒ Object
19 20 21 |
# File 'lib/blake2/key.rb', line 19 def self.none new([]) end |
Instance Method Details
#bytes ⇒ Object
3 4 5 |
# File 'lib/blake2/key.rb', line 3 def bytes @bytes end |