insomnia/app/database/util.js
Gregory Schier 860353474a Sidebar Sorting (#25)
* Got request moving working but is pretty messy

* Can now drag between groups

* Minor stuff

* Prevent deletion of last workspace

* Fixed some things

* Copy-pasta RequestGroup drag-n-drop

* Closes #2
2016-07-19 09:59:26 -07:00

14 lines
354 B
JavaScript

// NOTE: hard-to-distinguish characters have been remove like 0, o, O, etc...
const CHARS = '23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ'.split('');
export function generateId (prefix) {
let id = `${prefix}_${Date.now()}_`;
for (let i = 0; i < 13; i++) {
id += CHARS[Math.floor(Math.random() * CHARS.length)];
}
return id;
}