Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

seqid

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

seqid

Signed Integer sequential id generator. Similar to TCP sequencing.

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
166
increased by28.68%
Maintainers
1
Weekly downloads
 
Created
Source

seqid

NPM

seqid is a sequential id generator of the simplest variety. It is inspired by TCP sequencing, such that it will just generate integer sequential ids.

The ids generated are signed integers, I.e. if the id being generated would ever exceed 2147483648 it rolls over to -2147483647 and continues.

This means you can get repeated ids if you generate enough.

The ideal use-case for this tool is generating ephemeral ids for communication or coordination or matching.

var SeqId = require("seqid")

var id = SeqId(0)
console.log(id.next()) // 1
console.log(id.next()) // 2

API

var id = require("seqid")([initial])

Create the id generator with optional initial value. Otherwise it will generate a random initial value.

id.next()

Get the next value in sequence. It will always be a signed integer.

LICENSE

MIT

Keywords

FAQs

Package last updated on 19 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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