Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
test/ | 12-May-2024 | - | 14 | 12 | ||
.npmignore | D | 12-May-2024 | 42 | 7 | 5 | |
.travis.yml | D | 12-May-2024 | 139 | 12 | 11 | |
README.md | D | 12-May-2024 | 459 | 21 | 13 | |
index.js | D | 12-May-2024 | 692 | 20 | 11 | |
package.json | D | 12-May-2024 | 1.5 KiB | 57 | 56 |
README.md
1unique-slug 2=========== 3 4Generate a unique character string suitible for use in files and URLs. 5 6``` 7var uniqueSlug = require('unique-slug') 8 9var randomSlug = uniqueSlug() 10var fileSlug = uniqueSlug('/etc/passwd') 11``` 12 13### uniqueSlug(*str*) → String (8 chars) 14 15If *str* is passed in then the return value will be its murmur hash in 16hex. 17 18If *str* is not passed in, it will be 4 bytes coverted into 8 hex 19characters, generated by `crypto.pseudoRandomBytes`. 20 21