Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/igas/base62
Base62 encoder/decoder in pure Elixir
https://github.com/igas/base62
base62 decoder decoding elixir encoder encoding hacktoberfest
Last synced: 3 months ago
JSON representation
Base62 encoder/decoder in pure Elixir
- Host: GitHub
- URL: https://github.com/igas/base62
- Owner: elixirs
- License: mit
- Created: 2015-03-01T07:35:54.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-06-22T09:23:58.000Z (5 months ago)
- Last Synced: 2024-08-03T12:03:03.233Z (3 months ago)
- Topics: base62, decoder, decoding, elixir, encoder, encoding, hacktoberfest
- Language: Elixir
- Homepage:
- Size: 70.3 KB
- Stars: 20
- Watchers: 3
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-elixir - base62 - Base62 encoder/decoder in pure Elixir. (Text and Numbers)
- fucking-awesome-elixir - base62 - Base62 encoder/decoder in pure Elixir. (Text and Numbers)
- freaking_awesome_elixir - Elixir - Base62 encoder/decoder in pure Elixir. (Text and Numbers)
README
# Base62 [![Version](https://img.shields.io/hexpm/v/base62.svg?style=flat-square)](https://hex.pm/packages/base62)[![License](https://img.shields.io/hexpm/l/base62.svg?style=flat-square)](https://github.com/elixirs/base62/blob/main/LICENSE)![Build Status](https://img.shields.io/github/workflow/status/elixirs/base62/CI/main?style=flat-square)[![Issues](https://img.shields.io/github/issues/elixirs/base62.svg?style=flat-square)](https://github.com/elixirs/base62/issues)[![Downloads](https://img.shields.io/hexpm/dt/base62.svg?style=flat-square)](https://hex.pm/packages/base62)
Base62 encoder/decoder in pure Elixir.
## Usage
### Encode
```elixir
iex> Base62.encode(28)
"S"iex> Base62.encode(44)
"i"iex> Base62.encode(280)
"4W"
```### Decode!
```elixir
iex> Base62.decode!("100")
3844iex> Base62.decode!("igas")
10650166iex> Base62.decode!("EvilMartians")
776957886790921093120
```### Decode
```elixir
iex> Base62.decode("42")
{:ok, 250}iex> Base62.decode("Игас")
:erroriex> Base62.decode("Elixir")
{:ok, 13531063449}
```# [License](https://github.com/elixirs/base62/blob/main/LICENSE)
Released under the MIT License.