You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns a random v4 UUID of the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, where each x is replaced with a random hexadecimal digit from 0 to f, and y is replaced with a random hexadecimal digit from 8 to b.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@LeverOne, - operator should be faster than ^ (and it is, for about 10% in node.js). ^ uses Double ↔ Int32 conversion twice thus making significant overhead.
UPD: I was wrong, ^ is faster indeed in IE9. There's no visible difference between ^ and - cases in other browsers.
Unfortunately, gists can be forked but cannot be merged back. In order to avoid huge amount of hardly-ever traversable branches, let's imagine I've made a fork and then send you a pull request.
As a user, not a developer, of this fine node module, I have to say after reading the installation instructions I have but one gripe, and it is a very specific (if minor) one.
For installing a new module (in this case typing it into my editor by reading it from my napkin that I took to my friend's or something) I do not at all mind using all of the keys on my 105 key keyboard, but I'd love to avoid using one key many times and another not at all. You know, in order to have the color on the caps wear off evenly. If I have to install this module a bunch of times I mean.
It's fine for numbers and symbols to be a bit more frequent than letters, which I use a lot for other languages, mostly natural ones. But can this be evened out a bit in general? The characters seem repetitive at first glance.
Thank you for the module though. Oh, and a mnemonic would be nice so I don't always need the napkin for installation. Might make that another ticket.
Okay, I THINK I'm on track to understanding the trick behind the a*51&52 magic now (I suspect it functions similarly to this technique to determine if a number is a power of 2 - note that, due to the bodiless design of this for, where all evaluation is done in the post-loop "increment" statement, this procedure uses one-based indices and never has to deal with the zero case); I'm going to make a tool to see if I can refine the method for discovery.
nice work, @LeverOne. it's 1 byte shorter and faster too: https://jsperf.com/uuid-golf