util.js 215 B

123456789
  1. export default {
  2. // UUID
  3. getUUID () {
  4. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
  5. return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16)
  6. })
  7. }
  8. }