时间:2021-07-01 10:21:17 帮助过:3人阅读
2.Javascript开发生成UUID或GUID方法
/* 参数middle_line true:带中划线 false不带中划线*/ 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 += "-"; } } return result; };View Code
3.Oracle开发生成UUID或GUID方法
select SYS_GUID() from table_name
Java,Javascript,Oracle开发生成UUID或GUID方法总结
标签: