Socket
Socket
Sign inDemoInstall

deserialize-uuid

Package Overview
Dependencies
4
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    deserialize-uuid

extracts the timestamp from a version 1 UUID


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

node-deserialize-uuid

extracts the timestamp from a version 1 UUID

install

npm install deserialize-uuid

use

pass it a uuid-compatible uuid string

require('deserialize-uuid')('0c1d16c8-5c6a-11e4-90cf-12313b0e448d')

returns

{
  timestamp: <BigNum 136335499267479240>,
  timestampUtc: 1414275126747
}

timestamp is a BigNum for the integral value of the uuid's timestamp field (see RFC4122). timestampUtc is the difference in whole milliseconds between the moment that the timestamp field represents and the UNIX epoch. That means you can do new Date(timestampUtc).

Ideally it would also return the RFC4122 "node" and "clock sequence" fields, but I haven't implemented this yet.

Keywords

FAQs

Last updated on 30 Oct 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc