Created
          November 5, 2015 12:40 
        
      - 
      
- 
        Save sandcastle/16783a3fe74496b2d8ae to your computer and use it in GitHub Desktop. 
    Generates a new UUID in js.
  
        
  
    
      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
    
  
  
    
  | function getUuid() { | |
| function _p8(s) { | |
| var p = (Math.random().toString(16) + "000000000").substr(2, 8); | |
| return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p; | |
| } | |
| return _p8() + _p8(true) + _p8(true) + _p8(); | |
| }; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Extracted from:
https://github.com/MindscapeHQ/raygun4js/blob/master/src/raygun.js#L268