New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

iid

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iid

Internet Id (base62-encoded uuid/v4)

  • 0.9.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Iid - Simply Internet ID

Simply uuid/v4, base62-encoded, zero-justified to 22 chars

Looking around, the packages I found seemed shady. Or maybe it was NIH.

The purpose of Iid

  • Clean and simple for APIs, micro-service messaging, apps — you know; internet-stuff
  • Generate a 128-bit Uuid/v4, encoded as a 22-char base-62 string: "Iid"
  • Convert from and to Uuid/v4 standard 36-char format in hex for database-interfacing, external APIs, etc
  • Needless to say, loss less conversion with full 128-bit entropy

Sidenotes

  • Written in TypeScript for safety's sake, type-defs included
  • Uses arrays instead of buffers for broser-friendlyness
  • Compiles to ES-mod and CommonJs-mod, to suit direct nodejs-usage, and pre-compiler chains for tree-shaking

Example

say = console.log

const iid = Iid()
say(iid)

const uuid = Iid.toUuid(iid)
say(uuid)

const iid2 = Iid.fromUuid(uuid)
say(iid2)

say(iid === iid2)

Example output:

1eCH6Km2kWjIviA5l6q9VN
289b5d90-4f9b-4095-916b-d82451cf9f53
1eCH6Km2kWjIviA5l6q9VN
true

That's all folks!

Keywords

FAQs

Package last updated on 10 Feb 2018

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