Module: Flickrie::Base58
- Included in:
- Media
- Defined in:
- lib/flickrie/base58.rb
Constant Summary collapse
- ALPHABET =
'123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'.chars.to_a.freeze
Instance Method Summary collapse
Instance Method Details
#to_base58(value) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/flickrie/base58.rb', line 5 def to_base58(value) value = Integer(value) begin value, remainder = value.divmod(58) result = ALPHABET[remainder] + (result || '') end while value > 0 result end |