OCaml Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
docs
examples
.gitignore
.travis.yml
Hashids.ml
Hashids.mli
LICENSE
README.rst
hashids.opam
jbuild
run_development_cycle.sh
unit_tests.ml

README.rst

hashids-ocaml is an OCaml (4.02.3+) implementation of hashids. It generates short, unique, non-sequential ids from numbers, that you can also decode. It is compatible with version 1.0.0 of hashids.

It's licensed under the MIT license. It's available on OPAM, its documentation and its source code are on GitHub.

Questions? Remarks? Bugs? Want to contribute? Open an issue!

Quick start

Install from OPAM:

$ opam install hashids

Launch utop:

$ utop -require hashids

Create a config:

utop # let config = Hashids.make ();;
val config : Hashids.t = <abstr>

Encode some integers:

utop # Hashids.encode config [42; 57];;
- : string = "wYcGX"

And decode them:

utop # Hashids.decode config "wYcGX";;
- : int list = [42; 57]