Skip to content
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
doc
docs
examples
src
.devlpr.yml
.gitignore
.travis.yml
LICENSE
README.rst
dune-project
hashids.opam
run_development_cycle.sh

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]
You can’t perform that action at this time.