3 ms·
I was thinking of doing something similar (not spreadsheets, but open editable pages). How to do generate the ids?
by consultutah 12y ago
I was thinking of doing something similar (not spreadsheets, but open editable pages). How to do generate the ids?
- fiatjaf 12y agoI use https://www.npmjs.org/package/cuid https://www.npmjs.org/package/cuid
- fiatjaf 12y agoAbout open editable pages, are you imagining something like http://consultutah.42pag.es/ http://consultutah.42pag.es/?
- consultutah 12y agoNo, it's not really "editable pages". I've just got an idea for a weekend project that needs unique, but book markable pages. I could easily use a guid, but wanted a shorter id, saw this and thought I'd ask. Thx!
- stevekemp 12y agoA lot of simple sites just use an incrementing ID which is encoded in base36 for output: http://en.wikipedia.org/wiki/Base_36 http://en.wikipedia.org/wiki/Base_36 If you don't care about the lengths of identifiers you can instead use a GUID. Otherwise you're down to compressed strings that slowly expand in length, and uniqueness tests on generation.
- nateparrott 12y agoYou might also want to append some random data onto each id you assign, to prevent malicious bots from just iterating through all the id's and doing evil on them.