package nanoid
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
md5=a5c602bbac85b60218297f4705726ed9
sha512=debb9c4c0fb1ccadb4814cda797e96d380b20120e258b3b193635e65215a6fe74ab932fca40ab27d6502f72797326b44329952336bab2e745feb963d03e82419
Description
Added to opam-repository:
README
Nano ID for OCaml %%VERSION%%
This is an implementation of Nano ID, a tiny, secure, URL-friendly, unique string ID generator.
API
The API in documented in the source code. It mimics the Javascript interface and is mostly composed of a single entrypoint which generates a Nano ID of the given size, which defaults to 21.
val nanoid : ?size:int -> unit -> stringUsage
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 nanoid.os or nanoid.jsoo.
Unsupported features
Custom alphabets are not yet supported.
Native implementation
The native implementation mimics the javascript one and relies by default on 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 Simple ().
Dev Dependencies (4)
-
odoc
with-doc -
js_of_ocaml
with-test -
conf-npm
with-test -
alcotest
with-test
Optional Dependencies (1)
Used by
None
Conflicts
None
Build status
Results of building nanoid with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 1.0.0 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure