hscuid-1.2.0.0: Collision-resistant IDs

Portabilityportable
Stabilitystable
Safe HaskellNone

Web.Cuid

Description

You can generate a new CUID or slug inside any IO-enabled monad using newCuid and newSlug.

Synopsis

Documentation

type Cuid = TextSource

Convenience type so that you don't have to import Text downstream. Note that this is strict Text.

newCuid :: MonadIO m => m CuidSource

Generate a new random CUID.

type Slug = TextSource

A Slug is not a Cuid. But it is also a strict Text.

newSlug :: MonadIO m => m SlugSource

A slug is a shorter piece of text generated using some of the same techniques as CUIDs.