Forked from ulid-to-hex
Due to the original package being unpublished from NPM, I have forked it to keep it available.
Since the original package was unpublished, I have published this package as ulid-to-hex2
to avoid any conflicts.
May be useful if you are storing ULIDs in binary format, and your database CLI already supports querying by HEX values.
Parse ULID
npx ulid-to-hex2 01FCB79DXEHPQJRD8BWC6G7PVH
> 017B1674B7AE8DAF2C350BE30D03DB71
> 017b1674-b7ae-8daf-2c35-0be30d03db71
Parse HEX
npx ulid-to-hex2 0x017B1674B7AE8DAF2C350BE30D03DB71
> 01FCB79DXEHPQJRD8BWC6G7PVH
> 017b1674-b7ae-8daf-2c35-0be30d03db71
Parse UUID
npx ulid-to-hex2 017b1674-b7ae-8daf-2c35-0be30d03db71
> 017B1674B7AE8DAF2C350BE30D03DB71
> 01FCB79DXEHPQJRD8BWC6G7PVH
If you want just one value to be returned, you can use the flags --uuid
or --ulid
.
Example: Parse ULID to UUID only
npx ulid-to-hex2 01FCB79DXEHPQJRD8BWC6G7PVH --uuid
> 017b1674-b7ae-8daf-2c35-0be30d03db71
Example: Parse HEX to ULID only
npx ulid-to-hex2 0x017B1674B7AE8DAF2C350BE30D03DB71 --ulid
> 01FCB79DXEHPQJRD8BWC6G7PVH