🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

deserialize-uuid

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

deserialize-uuid

extracts the timestamp from a version 1 UUID

0.1.1
latest
Source
npm
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
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

parse

FAQs

Package last updated on 30 Oct 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