Socket
Socket
Sign inDemoInstall

ordered-uuid

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ordered-uuid

## Introduction


Version published
Weekly downloads
1.2K
increased by21.33%
Maintainers
1
Install size
38.9 kB
Created
Weekly downloads
 

Readme

Source

ordered-uuid

Introduction

The intent of UUIDs is to enable distributed systems to uniquely identify information without significant central coordination.

However, when storing UUIDs in a database, there is a need for UUIDs to be optimized in a way that allows the database to search, order and index them quickly.

The ordered-uuid module implements the results of research by Karthik Appigatla, originally based on work done by Peter Zaitsev. It can typically be used with RDBMSs which allow storage of 16-bit binary fields (e.g. Binary(16) in MySQL/MariaDB).

API

Module Functions

generate()

Generate an ordered UUID, and return it as a string.

toBinary16(orderedUUID)

Convenience function which intakes an ordered UUID string, and returns it as a hex-encoded Buffer object.

fromBinary16(binaryUUID)

Convenience function which intakes a hex-encoded binary Buffer object containing an ordered UUID, decodes it, and returns it as the original ordered-UUID string.

Examples

var OrderedUUID = require('ordered-uuid');

var orderedUuid = OrderedUUID.generate();
// '4352e80c5117dff996296b7531fbc4c0'

var binaryUuid = OrderedUUID.toBinary16(orderedUuid);
// <Buffer 43 52 e8 0c 51 17 df f9 96 29 6b 75 31 fb c4 c0>

var decodedUuid = OrderedUUID.fromBinary16(binaryUuid);
// '4352e80c5117dff996296b7531fbc4c0'

Questions and Issues

For all questions and issues, please open an Issue in GitHub.

License

Licensed liberally under MIT; see LICENSE for complete license text.

FAQs

Last updated on 15 Feb 2017

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