Socket
Socket
Sign inDemoInstall

nanoid

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanoid - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

3

CHANGELOG.md
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 1.0.6
* Fix documentation.
## 1.0.5

@@ -5,0 +8,0 @@ * Reduce `nanoid/index` size (by Anton Khlynovskiy).

3

format.js

@@ -7,3 +7,3 @@ /**

*
* @param {random} random The random bytess generator.
* @param {generator} random The random bytes generator.
* @param {string} alphabet Symbols to be used in new random string.

@@ -26,2 +26,3 @@ * @param {size} size The number of symbols in new random string.

* @name format
* @function
*/

@@ -28,0 +29,0 @@ module.exports = function (random, alphabet, size) {

@@ -20,2 +20,3 @@ var random = require('./random')

* @name generate
* @function
*/

@@ -22,0 +23,0 @@ module.exports = function (alphabet, size) {

@@ -5,18 +5,2 @@ var crypto = self.crypto || self.msCrypto

/**
* Generate secure URL-friendly unique ID.
*
* By default, ID will have 21 symbols to have a collision probability similar
* to UUID v4.
*
* @param {number} [size=21] The number of symbols in ID.
*
* @return {string} Random string.
*
* @example
* var nanoid = require('nanoid')
* model.id = nanoid() //=> "Uakgb_J5m9g~0JDMbcJqL"
*
* @name nanoid
*/
module.exports = function (size) {

@@ -23,0 +7,0 @@ size = size || 21

@@ -19,2 +19,3 @@ var random = require('./random')

* @name nanoid
* @function
*/

@@ -21,0 +22,0 @@ module.exports = function (size) {

{
"name": "nanoid",
"version": "1.0.5",
"version": "1.0.6",
"description": "A tiny (146 bytes), secure URL-friendly unique string ID generator",

@@ -40,3 +40,3 @@ "keywords": [

"rimraf": "^2.6.2",
"shortid": "^2.2.8",
"shortid": "^2.2.9",
"size-limit": "^0.18.3",

@@ -43,0 +43,0 @@ "svgo": "^1.0.5",

# Nano ID
<img src="img/logo.svg" alt="Nano ID logo by Anton Lovchikov"
width="180" height="94" align="right">
<img src="https://ai.github.io/nanoid/logo.svg" align="right"
alt="Nano ID logo by Anton Lovchikov" width="180" height="94">

@@ -42,3 +42,4 @@ A tiny, secure, URL-friendly, unique string ID generator for JavaScript.

Instead of using the unsafe `Math.random()`, Nano ID uses the `crypto` module
in Node.js and the Web Crypto API in browsers.
in Node.js and the Web Crypto API in browsers. This modules use unpredictable
hardware random generator.

@@ -86,3 +87,3 @@

uuid/v4 315,344 ops/sec
shortid 31,559 ops/sec
shortid 83,250 ops/sec
```

@@ -89,0 +90,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc