All Projects → adamhalasz → Uniqid

adamhalasz / Uniqid

Unique ID Generator

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Uniqid

Github Profile Readme Generator
🚀 Generate GitHub profile README easily with the latest add-ons like visitors count, GitHub stats, etc using minimal UI.
Stars: ✭ 7,812 (+1425.78%)
Mutual labels:  generator
Webpack Pwa Manifest
Progressive Web App Manifest Generator for Webpack, with auto icon resizing and fingerprinting support.
Stars: ✭ 447 (-12.7%)
Mutual labels:  generator
Mailtolink
A quick and easy way to generate markup for mailto links without having to worry about the annoying formatting.
Stars: ✭ 478 (-6.64%)
Mutual labels:  generator
Assemble
Community
Stars: ✭ 3,995 (+680.27%)
Mutual labels:  generator
Verb
HEADS UP! Verb is going though a major transition, we've completely refactored everything from the ground up. If you're interested, please see the dev branch.
Stars: ✭ 442 (-13.67%)
Mutual labels:  generator
Xcodegen
A Swift command line tool for generating your Xcode project
Stars: ✭ 5,032 (+882.81%)
Mutual labels:  generator
Datamodel Code Generator
Pydantic model generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources.
Stars: ✭ 393 (-23.24%)
Mutual labels:  generator
Simple Excel
Read and write simple Excel and CSV files
Stars: ✭ 502 (-1.95%)
Mutual labels:  generator
Tppdf
TPPDF is a simple-to-use PDF builder for iOS
Stars: ✭ 444 (-13.28%)
Mutual labels:  generator
Groupco
PHP的服务化框架。适用于Api、Http Server、Rpc Server;帮助原生PHP项目转向微服务化。出色的性能与支持高并发的协程相结合
Stars: ✭ 473 (-7.62%)
Mutual labels:  generator
Efqrcode
A better way to operate QR Code in Swift, support iOS, macOS, watchOS and tvOS.
Stars: ✭ 4,121 (+704.88%)
Mutual labels:  generator
Cssfilters
🌄 Custom and Instagram like photo filter playground for CSS built with React
Stars: ✭ 439 (-14.26%)
Mutual labels:  generator
Bogus
📇 A simple and sane fake data generator for C#, F#, and VB.NET. Based on and ported from the famed faker.js.
Stars: ✭ 5,083 (+892.77%)
Mutual labels:  generator
Honeyed Words Generator
在线生成土味情话
Stars: ✭ 408 (-20.31%)
Mutual labels:  generator
Laravel Code Generator
An intelligent code generator for Laravel framework that will save you time! This awesome tool will help you generate resources like views, controllers, routes, migrations, languages and/or form-requests! It is extremely flexible and customizable to cover many on the use cases. It is shipped with cross-browsers compatible template, along with a client-side validation to modernize your application.
Stars: ✭ 485 (-5.27%)
Mutual labels:  generator
Swift Auto Diagram
A Ruby script that scans all swift code from the specified folders and files and automatically generates an entity diagram (similar to a class diagram) which can be viewed in a browser.
Stars: ✭ 402 (-21.48%)
Mutual labels:  generator
Full Stack
Full stack, modern web application generator. Using Flask, PostgreSQL DB, Docker, Swagger, automatic HTTPS and more.
Stars: ✭ 451 (-11.91%)
Mutual labels:  generator
Coolie
Coolie(苦力) helps you to create models (& their constructors) from a JSON file.
Stars: ✭ 508 (-0.78%)
Mutual labels:  generator
Easy Wg Quick
Creates Wireguard configuration for hub and peers with ease
Stars: ✭ 502 (-1.95%)
Mutual labels:  generator
Badgen
Fast handcraft svg badge generator.
Stars: ✭ 464 (-9.37%)
Mutual labels:  generator

uniqid logo

unqiid npm badge uniqid npm downloads badge

A Unique Hexatridecimal ID generator.

It will always create unique id's based on the current time, process and machine name.

npm install uniqid

Usage

var uniqid = require('uniqid');

console.log(uniqid()); // -> 4n5pxq24kpiob12og9
console.log(uniqid(), uniqid()); // -> 4n5pxq24kriob12ogd, 4n5pxq24ksiob12ogl

Features

  • Very fast
  • Generates unique id's on multiple processes and machines even if called at the same time.
  • Shorter 8 and 12 byte versions with less uniqueness.

How it works

  • With the current time the ID's are always unique in a single process.
  • With the Process ID the ID's are unique even if called at the same time from multiple processes.
  • With the MAC Address the ID's are unique even if called at the same time from multiple machines and processes.

API:

uniqid( prefix optional string , suffix optional string )

Generate 18 byte unique id's based on the time, process id and mac address. Works on multiple processes and machines.

uniqid() -> "4n5pxq24kpiob12og9"
uniqid('hello-') -> "hello-4n5pxq24kpiob12og9"
uniqid('hello-', '-goodbye') -> "hello-4n5pxq24kpiob12og9-goodbye"

// usage with suffix only
uniqid('', '-goodbye') -> "4n5pxq24kpiob12og9-goodbye"
uniqid(undefined, '-goodbye') -> "4n5pxq24kpiob12og9-goodbye"

uniqid.process( prefix optional string , suffix optional string )

Generate 12 byte unique id's based on the time and the process id. Works on multiple processes within a single machine but not on multiple machines.

uniqid.process() -> "24ieiob0te82"

uniqid.time( prefix optional string , suffix optional string )

Generate 8 byte unique id's based on the current time only. Recommended only on a single process on a single machine.

uniqid.time() -> "iob0ucoj"

Webpack and Browserify

Since browsers don't provide a Process ID and in most cases neither give a Mac Address using uniqid from Webpack and Browserify falls back to uniqid.time() for all the other methods too. The browser is the single process, single machine case anyway.

Debug

Debug messages are turned off by default as of v4.1.0. To turn on debug messages you'll need to set uniqid_debug to true before you require the module.

// enable debug messages
module.uniqid_debug = true;

// require the module
var uniqid = require('uniqid');

License

(The MIT License)

Copyright (c) 2014-2021 Halász Ádám [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].