Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

unique-string

sindresorhus71mMIT3.0.0TypeScript support: included

Generate a unique random string

unique, string, random, text, id, identifier, slug, hex

readme

unique-string

Generate a unique random string

Install

$ npm install unique-string

Usage

import uniqueString from 'unique-string';

uniqueString();
//=> 'b4de2a49c8ffa3fbee04446f045483b2'

API

uniqueString()

Returns a 32 character unique string. Matches the length of MD5, which is unique enough for non-crypto purposes.