It is an npm package developed in order to allow you to convert Uuid strings to binary

Usage no npm install needed!

<script type="module">
  import uuidConverter from 'https://cdn.skypack.dev/uuid-converter';



It is an npm package developed to allow you to convert Uuid version 4 to binary. If you want to learn more about Uuid you can take a look at RFC 4122. Uuid is a good approach to be used as a primary key in the database since it does not expose any information about the data and can be generated anywhere in the application. However, an Uuid is 128 bits long and may cause performance issues due to their size. In this context, this package provides an easy way to convert Uuid to binary before sending it to the database.

How to install

It is provided as an npm package:

npm install uuid-converter

How to import

You can import this package using CommonJs:

const Uuid = require('uuid-converter');

Or using ES6:

import * as Uuid from 'uuid-converter';

How to use

You can generate an Uuid:

const uuid = Uuid.generate();


Then, convert it to a binary:

const binary = Uuid.stringToBinary(uuid);

<Buffer 79 88 95 c3 cc 7c 4b 59 9d 85 68 79 8d d3 67 61>

And also convert it to uuid again:

const uuid = Uuid.binaryToString(binary);