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