https://github.com/indexzero/uuid-time
Get time from RFC4122 uuids
https://github.com/indexzero/uuid-time
Last synced: about 1 year ago
JSON representation
Get time from RFC4122 uuids
- Host: GitHub
- URL: https://github.com/indexzero/uuid-time
- Owner: indexzero
- License: mit
- Created: 2014-12-09T03:33:45.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-09T04:21:06.000Z (over 11 years ago)
- Last Synced: 2024-04-29T01:42:03.416Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 106 KB
- Stars: 12
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# uuid-time
Get time from RFC4122 uuids
### Motivation
So there was [this pull-request](https://github.com/broofa/node-uuid/pull/49) on the mainline [`node-uuid`](https://github.com/broofa/node-uuid) that hasn't been merged since 2012. So I decided to strip it out into a stand-alone module because I needed it.
### Usage
``` js
//
// Remark: This also works with uuids generated from
// `require('uuid');`, which is a popular fork of `node-uuid`.
//
var uuidTime = require('uuid-time'),
uuid = require('node-uuid');
var v1 = uuid.v1();
var buf = uuid.parse(v1);
console.log('%s (string) created at %s', v1, uuidTime.v1(v1));
console.log('%s (buffer) created at %s', v1, uuidTime.v1(buf));
```
### Attribution
Much of this code was written by [Krassimir Fotev](https://github.com/krassif) in the pull request mentioned in Motivation. It was adapted and re-released under the MIT License.
##### License: MIT
##### Author: [Charlie Robbins](https://github.com/indexzero)