crypto-random-string (2.0.0)

Published 2026-02-24 13:54:45 +00:00 by atheaadmin

Installation

registry=
npm install crypto-random-string@2.0.0
"crypto-random-string": "2.0.0"

About this package

crypto-random-string Build Status

Generate a cryptographically strong random string

Can be useful for creating an identifier, slug, salt, fixture, etc.

Install

$ npm install crypto-random-string

Usage

const cryptoRandomString = require('crypto-random-string');

cryptoRandomString(10);
//=> '2cf05d94db'

API

cryptoRandomString(length)

Returns a hex string.

length

Type: number

Length of the returned string.

License

MIT © Sindre Sorhus

Dependencies

Development Dependencies

ID Version
ava ^1.4.1
tsd ^0.7.2
xo ^0.24.0

Keywords

random string text id identifier slug salt crypto strong secure hex
Details
npm
2026-02-24 13:54:45 +00:00
1
Sindre Sorhus
MIT
latest
1.9 KiB
Assets (1)
Versions (1) View all
2.0.0 2026-02-24