hex-object-id
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Hex ObjectId

A fast and small module that generates a random ObjectId as a hex string.

Should be compatible with the MongoDB ObjectId specification.

Throws if Date.now() returns a date after Feb 7th, 2106 06:28:15 UTC.

Installation

npm install --save hex-object-id

Usage

import hexObjectId from 'hex-object-id'

console.log(hexObjectId())
//=> 642cf99413ea465c2aaba3a3

API

hexObjectId()

  • returns string - a 24 character hex string representing a random ObjectId

Package Sidebar

Install

npm i hex-object-id

Weekly Downloads

872

Version

1.0.0

License

MIT

Unpacked Size

3.08 kB

Total Files

7

Last publish

Collaborators

  • linusu