Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dy/get-uid
Generate unique numeric id.
https://github.com/dy/get-uid
Last synced: about 2 months ago
JSON representation
Generate unique numeric id.
- Host: GitHub
- URL: https://github.com/dy/get-uid
- Owner: dy
- License: unlicense
- Created: 2015-01-25T14:10:47.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-25T14:17:31.000Z (almost 10 years ago)
- Last Synced: 2024-05-02T00:03:53.144Z (8 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# get-uid [![Build Status](https://travis-ci.org/dfcreative/get-uid.svg?branch=master)](https://travis-ci.org/dfcreative/get-uid) [![Code Climate](https://codeclimate.com/github/dfcreative/get-uid/badges/gpa.svg)](https://codeclimate.com/github/dfcreative/get-uid)
Simple random id generator.
`$ npm install get-uid`
```js
var getUid = require('get-uid');getUid(); //1178851014
getUid(); //811233864
...
```Yet another one uid generator? There are already some:
* gen-uid
* unique
* uid
* uid2
* uid-util
* micro-uid
* component-uid
* j-uid
* unique-id
* uniqid
* short-uid
* puid
* amp-unique-id
* genuid
* simple-uid
* random-id
* smart-id
* uuid-pure
* simple-random-id
* nidThis one is just shorter and simpler, almost like `id++`, but with no bad side-effects. The technique is used innerly by [Financial Times’ WeakSet](https://github.com/Financial-Times/polyfill-service/blob/master/polyfills/WeakSet/polyfill.js), [Web-components’ WeakMap](https://github.com/webcomponents/webcomponentsjs/blob/master/src/WeakMap/WeakMap.js) and so on.
[![NPM](https://nodei.co/npm/get-uid.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/get-uid/)