{"id":15600439,"url":"https://github.com/dougal/base58","last_synced_at":"2025-04-05T13:07:49.399Z","repository":{"id":554997,"uuid":"185608","full_name":"dougal/base58","owner":"dougal","description":"Base58 is a Ruby library/gem for converting ints to and from base58.","archived":false,"fork":false,"pushed_at":"2022-12-29T12:25:53.000Z","size":38,"stargazers_count":88,"open_issues_count":0,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T12:07:51.078Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rdoc.info/projects/dougal/base58/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"zzsnzmn/py-http-signature","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dougal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-04-25T20:32:56.000Z","updated_at":"2025-03-11T22:16:48.000Z","dependencies_parsed_at":"2023-01-13T10:28:52.114Z","dependency_job_id":null,"html_url":"https://github.com/dougal/base58","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougal%2Fbase58","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougal%2Fbase58/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougal%2Fbase58/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougal%2Fbase58/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dougal","download_url":"https://codeload.github.com/dougal/base58/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T02:03:02.072Z","updated_at":"2025-04-05T13:07:49.383Z","avatar_url":"https://github.com/dougal.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Base58\n\nRuby gem for encoding/decoding integers to/from Base58. Supports Flickr, Bitcoin, and Ripple alphabets.\n\n\n## Usage\n\nConverting an integer into a Base58 string:\n\n```ruby\nBase58.int_to_base58(12345) # =\u003e \"4ER\"\n```\n\nConverting a Base58 string to the represented integer:\n\n```ruby\nBase58.base58_to_int(\"A2Ph\") # =\u003e 6639914\n```\n\nConverting binary into a Base58 string:\n\n```ruby\nBase58.binary_to_base58(\"\\xCE\\xE99\\x86\".force_encoding('BINARY')) # =\u003e \"6hKMCS\"\n```\n\nConverting a Base58 string to the represented binary:\n\n```ruby\nBase58.base58_to_binary(\"6hKMCS\") # =\u003e \"\\xCE\\xE99\\x86\"\n```\n\n\n## Installation\n\nInstall `base58` with the following command\n\n```bash\ngem install base58\n```\n\nOr add it to your Gemfile\n\n```ruby\ngem 'base58'\n```\n\nThen run `bundle install`.\n\n\n## What is Base58?\n\nFrom [Wikipedia](https://en.wikipedia.org/wiki/Base58):\n\n\u003e Base58 is a group of binary-to-text encoding schemes used to represent large integers as alphanumeric text. It is similar to Base64 but has been modified to avoid both non-alphanumeric characters and letters which might look ambiguous when printed. It is therefore designed for human users who manually enter the data, copying from some visual source, but also allows easy copy and paste because a double-click will usually select the whole string.\n\nBase58 alphabets are made up of the characters a-z, A-Z, and 0-9, with visually ambiguous characters (0, O, I, l) removed.\n\n\n## Supported Alphabets\n\nThis library supports three of the most common Base58 alphabets, which have identical, but differently sorted characters.\n\nAlphabets can be selected by passing a symbol to the second argument of `Base58.int_to_base58` and `Base58.base58_to_int`.\n\n```ruby\nBase58.int_to_base58(12345, :bitcoin)\n```\n\n`:flickr` is the default if no second argument is passed.\n\n\n### Flickr\n\nIdentifier: `:flickr`\n\nThis is the default alphabet. Used to generate [Flickr short URLs](https://www.flickr.com/groups/api/discuss/72157616713786392/). The order of it's characters is numeric, lowercase-alpha, uppercase-alpha.\n\n    123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ\n\n\n### Bitcoin\n\nIdentifier: `:bitcoin`\n\nThe alphabet used by the [Bitcoin](https://en.wikipedia.org/wiki/Bitcoin) protocol. The order of it's characters is numeric, uppercase-alpha, lowercase-alpha.\n\n    123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\n\nSee the \"Leading Zeros\" section for enabling full Bitcoin-style leading-zeros support.\n\n\n### Ripple\n\nIdentifier: `:ripple`\n\nThe alphabet used by the [Ripple protocol](https://en.wikipedia.org/wiki/Ripple_(payment_protocol)). The order of the characters were chosen such that the [low values match the primitives of the protocol](http://bitcoin.stackexchange.com/questions/14124/why-is-ripples-base58-alphabet-so-weird).\n\n    rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz\n\n\n## Leading Zeroes\n\nSome protocols, such as Bitcoin, require that leading zeros be encoded. Passing `true` to the third argument of binary_to_base58()` will enable this behaviour.\n\n```ruby\nbitcoin_address_hex = '00000000000000000000123456789ABCDEF0'\nbitcoin_address_bin = [bitcoin_address_hex].pack('H*')\n\nBase58.binary_to_base58(bitcoin_address_bin, :bitcoin, true) # =\u003e 111111111143c9JGph3DZ\n```\n\n## Contributing\n\nSource repository is on [Github](https://github.com/dougal/base58), please file issues and pull requests there.\n\n\n## Documentation\n\nDocumentation can be found online at [RubyDoc.info](http://www.rubydoc.info/github/dougal/base58).\n\nAlternatively, you can generate docs from the project root with:\n\n```bash\nrake rdoc\n```\n\n\n## Credits\n\n  * [Joel Nordell](https://github.com/joelnordell) for various Bitcoin/Ripple support features.\n  * [Jim Myhrberg](https://github.com/jimeh) for argument checking and method aliases.\n\n\n## Copyright and Licence\n\nCopyright (c) 2009 - 2018, Douglas F Shearer.\n\nBase58 is licensed under the MIT Licence.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougal%2Fbase58","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdougal%2Fbase58","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougal%2Fbase58/lists"}