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
516 |
# File 'lib/bitcoin.rb', line 516 def bth; unpack("H*")[0]; end |
#htb ⇒ Object
hex-to-bin
518 |
# File 'lib/bitcoin.rb', line 518 def htb; [self].pack("H*"); end |
#htb_reverse ⇒ Object
520 |
# File 'lib/bitcoin.rb', line 520 def htb_reverse; htb.reverse; end |
#hth ⇒ Object
521 |
# File 'lib/bitcoin.rb', line 521 def hth; unpack("H*")[0]; end |
#reverse_hth ⇒ Object
522 |
# File 'lib/bitcoin.rb', line 522 def reverse_hth; reverse.hth; end |