Skip to content
Generate a unique character string suitible for use in files and URLs.
JavaScript
Branch: master
Clone or download
Latest commit 36b094b Jun 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test hash: switch from MD5 to murmur hash Dec 3, 2015
.gitignore test: add coverage report on test Dec 3, 2015
.travis.yml meta: update travis to test on supported versions of Node.js (#7) Jun 1, 2019
LICENSE Add LICENSE file Sep 20, 2018
README.md Update description Jun 1, 2019
index.js remove unused import Jun 1, 2019
package-lock.json 2.0.2 Jun 11, 2019
package.json 2.0.2 Jun 11, 2019

README.md

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.

You can’t perform that action at this time.