import SnowflakeId from 'snowflake-id'
const snowflake = new SnowflakeId() // 生成雪花id方法 snowflake.generate()
// import { nanoid } from 'nanoid'
export default function () {
  return String(snowflake.generate()) // => "V1StGXR8_Z5jdHi6B-myT"
}


// let urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'

// export const nanoid = (size = 21) => {
//   let id = ''
//   // A compact alternative for `for (var i = 0; i < step; i++)`.
//   let i = size
//   while (i--) {
//     // `| 0` is more compact and faster than `Math.floor()`.
//     id += urlAlphabet[(Math.random() * 64) | 0]
//   }
//   return id
// }