https://github.com/arturictus/firebase_pushid
Firebase pushid client generation
https://github.com/arturictus/firebase_pushid
elixir firebase unique-id
Last synced: about 2 months ago
JSON representation
Firebase pushid client generation
- Host: GitHub
- URL: https://github.com/arturictus/firebase_pushid
- Owner: arturictus
- Created: 2018-05-12T19:33:53.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-13T09:10:48.000Z (about 8 years ago)
- Last Synced: 2026-04-06T16:41:53.574Z (3 months ago)
- Topics: elixir, firebase, unique-id
- Language: Elixir
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FirebasePushid
Generates Firebase id. [article](https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html)
It caches with previous timestamp.
If same timestamp is stored in the cache it will generate an incremental id
in base 64 trying to increment the last possible character.
ex:
1) -Kyukibfm7T0jJT_Deyr
2) -Kyukibfm7T0jJT_Deys
If last can not be incremented will update the next
ex:
1) -KyukibfiPUIPSaeXo9z
2) -KyukibfiPUIPSaeXoA-
3) -KyukibfiPUIPSaeXoA0
...
x) -KyukibfiPUIPSaeXoAz
x) -KyukibfiPUIPSaeXoB-
x) -KyukibfiPUIPSaeXoB0
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `firebase_pushid` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:firebase_pushid, "~> 0.1.0"}]
end
```
```elixir
def application do
[applications: [:firebase_pushid]]
end
```
And fetch your project's dependencies:
```
$ mix deps.get
```
## Usage
```elixir
iex> FirebasePushid.generate
"-KzO0n9zzKuWHH9i5t0l"
```
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/firebase_pushid](https://hexdocs.pm/firebase_pushid).