Nano ID for OCaml %%VERSION%%
This is an implementation of Nano ID, a tiny, secure, URL-friendly, unique string ID generator.
val nanoid : ?size:int -> unit -> string
Nanoid supports both native and js_of_ocaml environments via a virtual library:
nanoid. Libraries should depend on this library, and final executables should pick an implementation by depending either on
Custom alphabets are not yet supported.
cryptokit pseudo random number generator seeded with the current unix time as given by
Unix.gettimeofday. This should yield satisfying results for most application without ever blocking, unless you need strong cryptographic guarantees for security reasons.
One can customize the random number generation by using the
nanoid_os library instead. The generated module will only work in native code. One can regain this genericity by functorizing over the
Nanoid_os.S interface. The setup used in
nanoid.os is the one generated by