MCPcopy
hub / github.com/microfeed/microfeed / randomShortUUID

Function randomShortUUID

common-src/StringUtils.js:20–30  ·  view source on GitHub ↗
(length = 11)

Source from the content-addressed store, hash-verified

18}
19
20export function randomShortUUID(length = 11) {
21 const asciiLowercase = 'abcdefghijklmnopqrstuvwxyz';
22 const asciiUppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
23 const digits = '0123456789';
24 const allChars = asciiLowercase + asciiUppercase + digits + '_-';
25 let result = '';
26 for (let i = 0; i < length; i++) {
27 result += allChars.charAt(Math.floor(Math.random() * allChars.length));
28 }
29 return result;
30}
31
32export function secondsToHHMMSS(secs) {
33 if (!secs) {

Callers 7

initDbMethod · 0.90
upsertItemMethod · 0.90
initMethodsDictFunction · 0.90
renderMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected