Module: Bitcoin::BinaryExtensions
- Included in:
- String
- Defined in:
- lib/bitcoin.rb
Instance Method Summary collapse
-
#bth ⇒ Object
bin-to-hex.
-
#htb ⇒ Object
hex-to-bin.
- #htb_reverse ⇒ Object
- #hth ⇒ Object
- #reverse_hth ⇒ Object
Instance Method Details
#bth ⇒ Object
bin-to-hex
442 |
# File 'lib/bitcoin.rb', line 442 def bth; unpack("H*")[0]; end |
#htb ⇒ Object
hex-to-bin
444 |
# File 'lib/bitcoin.rb', line 444 def htb; [self].pack("H*"); end |
#htb_reverse ⇒ Object
446 |
# File 'lib/bitcoin.rb', line 446 def htb_reverse; htb.reverse; end |
#hth ⇒ Object
447 |
# File 'lib/bitcoin.rb', line 447 def hth; unpack("H*")[0]; end |
#reverse_hth ⇒ Object
448 |
# File 'lib/bitcoin.rb', line 448 def reverse_hth; reverse.hth; end |