MCPcopy
hub / github.com/appwrite/sdk-for-react-native / unique

Method unique

src/id.ts:18–27  ·  view source on GitHub ↗
(padding: number = 7)

Source from the content-addressed store, hash-verified

16 }
17
18 public static unique(padding: number = 7): string {
19 // Generate a unique ID with padding to have a longer ID
20 const baseId = ID.#hexTimestamp();
21 let randomPadding = '';
22 for (let i = 0; i < padding; i++) {
23 const randomHexDigit = Math.floor(Math.random() * 16).toString(16);
24 randomPadding += randomHexDigit;
25 }
26 return baseId + randomPadding;
27 }
28}

Callers

nothing calls this directly

Calls 2

#hexTimestampMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected