Collision-resistant IDs for horizontal scaling
Latest commit 4c21e9f Nov 22, 2016 @crabmusket committed on GitHub Update Travis CI URL in readme
I changed my github account name #noregrets


Build Status Hackage

A Haskell port of the JavaScript library for collision-resistant identifiers. To install, cabal install hscuid.

What is a CUID?

CUIDs are short random strings designed so that you can generate a lot of them over many different machines and not get collisions. They are intended to be usable in situations from HTML element IDs to database keys. You can read more about them at

How do I use this library?

>>> import Web.Cuid (newCuid, newSlug)
>>> newCuid
>>> newSlug


I am currently developing with Stack. To install dependencies and compile the library and test suites:

stack init --resolver nightly
stack build

To run the collision test suite (which generates 1.2M IDs and makes sure they're all unique):

stack test

To test performance with criterion:

stack exec perf-test -- --regress allocated:iters +RTS -T