java,javascript,oracle development generate UUID or GUID method summary

Source: Internet
Author: User
Tags uuid

1.Java development generate UUID or GUID method

// 36-bit, with dash  //  32-bit, remove the middle dash Java.util.UUID.randomUUID (). toString (). ReplaceAll ("-", "" ");


2.Javascript development generate UUID or GUID method

/*parameter Middle_line true: with an underscore false without an underscore*/function NewGuid (middle_line) {var length= 32; var result= "";  for(var i = 1; I <= length; i++) {var n= Math.floor (Math.random () * 16.0); if(N < 10) {result+=N; }             Else if(n = = 10) {result+ = "a"; }             Else if(n = = 11) {result+ = "B"; }             Else if(n = = 12) {result+ = "C"; }             Else if(n = = 13) {result+ = "D"; }             Else if(n = = 14) {result+ = "E"; }             Else if(n = = 15) {result+ = "F"; }             if(Middle_line && (i = = 8) | | (i = = 12) | | (i = = 16) | | (i = = 20)) {result+= "-"; }         }         returnresult; };
View Code

3.Oracle development generate UUID or GUID method

Select  from

java,javascript,oracle development generate UUID or GUID method summary

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.