unique-slug

Generate a unique character string suitible for use in files and URLs.

ISC 9 个版本
安装
npm install unique-slug
yarn add unique-slug
pnpm add unique-slug
bun add unique-slug
README

unique-slug

Generate a unique character string suitible for use in files and URLs.

var uniqueSlug = require('unique-slug')

var randomSlug = uniqueSlug()
var fileSlug = uniqueSlug('/etc/passwd')

uniqueSlug(str) → String (8 chars)

If str is passed in then the return value will be its murmur hash in hex.

If str is not passed in, it will be 4 randomly generated bytes converted into 8 hexadecimal characters.

版本列表
7.0.0 2026-05-08
6.0.0 2025-10-22
5.0.0 2024-09-25
4.0.0 2022-10-14
3.0.0 2022-08-22
2.0.2 2019-06-11
2.0.1 2018-09-20
2.0.0 2015-12-03
1.0.0 2015-05-07