https://github.com/confuser/node-mongo-uuid-helper
NodeJS UUID helper based on official C# driver
https://github.com/confuser/node-mongo-uuid-helper
Last synced: 9 months ago
JSON representation
NodeJS UUID helper based on official C# driver
- Host: GitHub
- URL: https://github.com/confuser/node-mongo-uuid-helper
- Owner: confuser
- License: isc
- Created: 2015-01-18T19:51:31.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-12-05T04:09:21.000Z (over 1 year ago)
- Last Synced: 2025-08-16T17:14:34.655Z (10 months ago)
- Language: JavaScript
- Size: 268 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mongo UUID Helper
[](https://travis-ci.org/confuser/node-mongo-uuid-helper)
[](https://coveralls.io/r/confuser/node-mongo-uuid-helper?branch=master)
[](https://snyk.io/test/github/confuser/node-mongo-uuid-helper?targetFile=package.json)
A NodeJS UUID helper, based on the [C# driver UUID helper](https://github.com/mongodb/mongo-csharp-driver/blob/master/uuidhelpers.js)
Currently only implements JUUID and CSUUID, PR's welcome.
## Installation
```
npm install mongo-uuid-helper
```
## Usage
```js
const uuidHelper = require('mongo-uuid-helper')
const juuidBin = uuidHelper.juuidStringToBin('ae51c849-3f2a-4a37-986d-55ed5b02307f')
const csuuidBin = csuuidHelper.csuuidStringToBin('0c552563-77d2-4562-a9bd-739ba2c6e1fe')
const jUUID = uuidHelper.binToJUUIDString(juuidBin)
const csUUID = uuidHelper.binToCSUUIDString(csuuidBin)
```