question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to remove dashes

See original GitHub issue

Sometimes 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:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
broofacommented, Nov 26, 2018

@LeoDupont: I have zero interest supporting non-standard id formats.

4reactions
LeoDupontcommented, Nov 22, 2018

@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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found