MCPcopy Create free account
hub / github.com/Lundalogik/lime-elements / createRandomString

Function createRandomString

src/util/random-string.ts:1–10  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1export const createRandomString = () => {
2 if (
3 !('crypto' in window) ||
4 typeof window.crypto?.randomUUID !== 'function'
5 ) {
6 return legacyCreateRandomString();
7 }
8
9 return 'a_' + crypto.randomUUID(); // ids must start with letters
10};
11
12function legacyCreateRandomString() {
13 const USE_HEX = 36;

Callers 15

renderItemsMethod · 0.90
constructorMethod · 0.90
IconButtonClass · 0.90
CheckboxClass · 0.90
BreadcrumbsClass · 0.90
constructorMethod · 0.90
SwitchClass · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90

Calls 1

legacyCreateRandomStringFunction · 0.85

Tested by

no test coverage detected