2.1.5 • Published 7 years ago

uid-safe v2.1.5

Weekly downloads
1,495,532
License
MIT
Repository
github
Last release
7 years ago

uid-safe

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

URL and cookie safe UIDs

Create cryptographically secure UIDs safe for both cookie and URL usage. This is in contrast to modules such as rand-token and uid2 whose UIDs are actually skewed due to the use of % and unnecessarily truncate the UID. Use this if you could still use UIDs with - and _ in them.

Installation

$ npm install uid-safe

API

var uid = require('uid-safe')

uid(byteLength, callback)

Asynchronously create a UID with a specific byte length. Because base64 encoding is used underneath, this is not the string length. For example, to create a UID of length 24, you want a byte length of 18.

uid(18, function (err, string) {
  if (err) throw err
  // do something with the string
})

uid(byteLength)

Asynchronously create a UID with a specific byte length and return a Promise.

Note: To use promises in Node.js prior to 0.12, promises must be "polyfilled" using global.Promise = require('bluebird').

uid(18).then(function (string) {
  // do something with the string
})

uid.sync(byteLength)

A synchronous version of above.

var string = uid.sync(18)

License

MIT

express-session-samesite-backportexpress-session-samesite-oldverszegedsw-lib-node@kohanajs/express-sessiongovuk-casanahan-sessionfrodo-downloader@liquicode/lib-server-kit@picker-cc/core@infinitebrahmanuniverse/nolb-uidsails-keosface-captcha-core@everything-registry/sub-chunk-3006simgr-pg-serversimgr-serversignpassserverless-escapia-robotifysession-managedual-clientpoolsirsen-customidegg-mp-sessionsocket.io-mysql-sessionenhancer-sessiondish-libreact-native-ok-sdkdiet-sessdiet-sessiondolphin-express-sessiondiesel-engineredis-rxjs-utilsrebasredis-sessredis-user-sessionssails-coresails-sequelizesailssails-angular2-isomorphicreact-simple-peersaturnialretrofeedeasy-servicesocketstream-cookie-sessioncsrfcsrf-protectcsrf-tokenseasy_express_sessiononeline-fastify-sessionburak-session@back4app/back4app-restotp.jscas-server@balderdash/sails-edgecatfish.jscelix-express-session@caesar003/slider-captcha-core@brudi-toolbox/id@carllewi2/sapcdc-ally-driverpoor-sessionpomjs-qccostpomjscollector-jsoncollector-pipeline@cloudedots/express-session-tokenlicense-key-genlicense-keygen-nextlinux-remote-server@cond/express-session@cocoaws/apollo-server-boilerplate@croquiscom/express-sessioncouer-sessioncellpack-sessionchestnut-sessionpeter.you.jqweui.test.publishchat-service@beanjs/fastify-sessionchoreo@bolttech/frontend-session@bolttech/server-side-nextpdf-generator-servicenpmtest-05041blue-prod@architect/functionsblpapi-httpbox-backend@authnomicon/openidconnectbtrz-express-base-web@cnwhy/express-sessionprismy-sessionrabbitmq_servicesctartist621-sails@davidsemakula/express-session@dazedi/fastify-sessionr0ten-sails@dr.pogodin/csurfnodeframenodejs-license-keybetter-koa-sessionbeta-express-sessionniugu-wap-express-session@alexop/express-session
2.1.5

7 years ago

2.1.4

7 years ago

2.1.3

7 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

9 years ago

1.1.0

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

10 years ago

1.0.0

10 years ago