hscuid-1.2.0.1: Collision-resistant IDs

Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Web.Cuid

Description

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

Synopsis

Documentation

type Cuid = Text Source #

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

newCuid :: MonadIO m => m Cuid Source #

Generate a new random CUID.

type Slug = Text Source #

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

newSlug :: MonadIO m => m Slug Source #

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