module Base58

shared code for formats / variants with single char alphabets

e.g. Bitcoin, Flickr, ...

Constants

MAJOR
MINOR
PATCH
VERSION

Public Class Methods

alphabet( klass: configuration.format ) click to toggle source

encoding alphabet - letter-to-number by index / array

# File lib/base58-alphabets/base58.rb, line 56
def self.alphabet( klass: configuration.format ) klass.alphabet; end
banner() click to toggle source
configuration() click to toggle source

lets you use

Base58.configure do |config|
   config.format     =  :bitcoin
end
# File lib/base58-alphabets/base58.rb, line 30
def self.configuration
  @configuration ||= Configuration.new
end
configure() { |configuration| ... } click to toggle source
# File lib/base58-alphabets/base58.rb, line 34
def self.configure
  yield( configuration )
end
decode_bin( str, klass: configuration.format ) click to toggle source
# File lib/base58-alphabets/base58.rb, line 50
def self.decode_bin( str,  klass: configuration.format ) klass.decode_bin( str ); end
decode_hex( str, klass: configuration.format ) click to toggle source
# File lib/base58-alphabets/base58.rb, line 51
def self.decode_hex( str,  klass: configuration.format ) klass.decode_hex( str ); end
decode_num( str, klass: configuration.format ) click to toggle source
# File lib/base58-alphabets/base58.rb, line 49
def self.decode_num( str,  klass: configuration.format ) klass.decode_num( str ); end
encode_bin( data, klass: configuration.format ) click to toggle source
# File lib/base58-alphabets/base58.rb, line 46
def self.encode_bin( data, klass: configuration.format ) klass.encode_bin( data ); end
encode_hex( str, klass: configuration.format ) click to toggle source
# File lib/base58-alphabets/base58.rb, line 47
def self.encode_hex( str,  klass: configuration.format ) klass.encode_hex( str );  end
encode_num( num, klass: configuration.format ) click to toggle source
# File lib/base58-alphabets/base58.rb, line 45
def self.encode_num( num,  klass: configuration.format ) klass.encode_num( num );  end
format() click to toggle source

add convenience helper for format

# File lib/base58-alphabets/base58.rb, line 39
def self.format() configuration.format; end
format=(value) click to toggle source
# File lib/base58-alphabets/base58.rb, line 40
def self.format=(value) self.configuration.format = value; end
number( klass: configuration.format ) click to toggle source

decoding letter-to-number mapping / hash

# File lib/base58-alphabets/base58.rb, line 59
def self.number( klass: configuration.format ) klass.number; end
root() click to toggle source
# File lib/base58-alphabets/version.rb, line 17
def self.root
  File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
end
version() click to toggle source
# File lib/base58-alphabets/version.rb, line 9
def self.version
  VERSION
end