Option to remove dashes
See original GitHub issueSometimes there is a requirement to get 32 character UUID (may be I shouldn’t call that UUID 😃 ). However the UUID generated by this library is 36 chars length. Because of dashes.
Is it possible to add an option to omit dashes? Something like this:
function v4(options, buf, offset) {
...
return buf || bytesToUuid(rnds, 0, options.nodash);
}
function bytesToUuid(buf, offset, nodash) {
var i = offset || 0;
var bth = byteToHex;
return bth[buf[i++]] + bth[buf[i++]] +
bth[buf[i++]] + bth[buf[i++]] + (nodash ? '' : '-') +
...
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How To Remove Dashes in Excel: A Step-by-Step Guide
A popular method to remove dashes in Excel is by using the SUBSTITUTE formula. If you're comfortable using formulas in Excel, this is...
Read more >How to quickly remove dashes from cells in Excel?
1. Highlight the range that you want to remove the dashes. · 2. Hold down the ALT + F11 keys to open the...
Read more >How to Remove Dashes in Excel - Simple Sheets
Below the border icon, you'll find some options. Select None. Step Five: Press Ok. Now, this excel process example shows you a writing...
Read more >Remove Dashes (-) in Excel - Fundsnet Services
Remove Dashes (-) in ExcelHere are two easy ways to remove dashes (or hyphens) in Excel ... Click on it and select the...
Read more >How to Remove Dashes or Hyphen (-) in Excel - Computing.NET
Removing dashes and hyphens one by one is simply not an option when you have large amounts of data. It is a tedious...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@LeoDupont: I have zero interest supporting non-standard id formats.
@broofa : I also need to get non-canonical UUIDs (without dashes), and it may be the case for many users.
Indeed, using
replace()
works, but it might be a nice touch to add an option that would not include the dashes in the first place, for better performance and cleaner code.What are your thoughts?