npm/unique-slug

Name: unique-slug

Owner: npm

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

Created: 2015-05-07 22:25:03.0

Updated: 2018-05-18 15:55:10.0

Pushed: 2016-08-01 13:00:37.0

Homepage: null

Size: 5

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

unique-slug

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

uniqueSlug = require('unique-slug')

randomSlug = uniqueSlug()
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 bytes coverted into 8 hex characters, generated by crypto.pseudoRandomBytes.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.