uuid-d64
Advanced tools
Comparing version 1.0.4 to 1.0.5
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const d64 = require("d64"); | ||
const testRegex = /([0-9a-fA-F]{8})-([0-9a-fA-F]{4})-([0-9a-fA-F]{4})-([0-9a-fA-F]{4})-([0-9a-fA-F]{12})/; | ||
const _bytesToHex = []; | ||
@@ -10,4 +9,2 @@ for (let i = 0; i < 256; i++) { | ||
exports.encode = (uuid) => { | ||
if (testRegex.test(uuid) === false) | ||
throw new TypeError('invalid uuid'); | ||
return d64.encode(Buffer.from(uuid.split('-').join(''), 'hex')); | ||
@@ -14,0 +11,0 @@ }; |
{ | ||
"name": "uuid-d64", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Compression codec for uuid to d64 (22 bytes)", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
5329
25