Converts UUID v1 strings to BINARY(16) buffers with time-ordering scrambling optimized for MySQL indexing. Version 2.0.3 is current, stable, and rarely updated. Key differentiator: reorders UUID v1 bytes so that the timestamp component (which changes fastest) is placed in the middle of the binary representation, improving B-tree index performance. Supports both ESM imports and CommonJS require. Includes helpers to convert between string UUID and Buffer representations.
npm install binary-uuidNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates generating a binary UUID, round-tripping buffer to string, and converting an existing UUID string to buffer.
Run 'npm install uuid' alongside binary-uuid.
Use const createBinaryUUID = require('binary-uuid').default;Always use UUID v1 with this package for binary storage.
Ensure input matches 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' format.
const createBinaryUUID = require('binary-uuid').default;npm install uuid
import { fromBinaryUUID } from 'binary-uuid';