An open API service indexing awesome lists of open source software.

https://github.com/chancehudson/random-objectid

Generate a 12 byte hexadecimal string that can act as a mongo ObjectID
https://github.com/chancehudson/random-objectid

Last synced: 3 months ago
JSON representation

Generate a 12 byte hexadecimal string that can act as a mongo ObjectID

Awesome Lists containing this project

README

          

# random-objectid

Returns a Promise that will resolve to a random 12 byte hex string.

## Install

In a project:
```sh
npm install --save-dev random-objectid
```

Globally:
```sh
npm install --global random-objectid
```

## Usage

In code:

```js
const randomObjectId = require('random-objectid')

() => {
const testId = randomObjectId()
console.log('generated random id', testId)
}
```

From CLI:

```sh
$ random-objectid
37bfc2ff43cfc1ef75abe9c3
```

# License

MIT