https://github.com/railsmechanic/simple_token
SimpleToken generates random alphanumeric, non-cryptographic string tokens.
https://github.com/railsmechanic/simple_token
elixir token
Last synced: over 1 year ago
JSON representation
SimpleToken generates random alphanumeric, non-cryptographic string tokens.
- Host: GitHub
- URL: https://github.com/railsmechanic/simple_token
- Owner: railsmechanic
- License: mit
- Created: 2016-11-03T10:21:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-03T13:16:28.000Z (over 9 years ago)
- Last Synced: 2025-01-22T10:15:03.420Z (over 1 year ago)
- Topics: elixir, token
- Language: Elixir
- Homepage: https://hex.pm/packages/simple_token
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SimpleToken
SimpleToken generates random alphanumeric, non-cryptographic string tokens.
## Installation
1. Add `simple_token` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:simple_token, "~> 0.1.0"}]
end
```
2. Fetch dependencies
```bash
mix deps.get
```
## Usage
SimpleToken is really simple to use:
#### 1. Generate a token with the default length of 16 characters
```elixir
token = SimpleToken.generate # => token: "BKjW17nVOuwekNgP"
```
#### 2. Generate a token with a custom length
```elixir
token = SimpleToken.generate(24) # => token: "fCleyrpZAO9LXKtsR1xUMFPj"
```
## License
See [LICENSE](https://github.com/railsmechanic/simple_token/blob/master/LICENSE).