guid.js 373 B

12345678910111213
  1. export function getGuid() {
  2. function S4() {
  3. return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
  4. }
  5. return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
  6. }
  7. export function getTimeStamp() {
  8. var tmp = Date.parse(new Date()).toString()
  9. tmp = tmp.substr(0, 10)
  10. return tmp
  11. }