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