MCPcopy Index your code
hub / github.com/AnswerOverflow/AnswerOverflow / getRandomId

Function getRandomId

packages/utils/src/id.ts:6–10  ·  view source on GitHub ↗
(length: number = 15)

Source from the content-addressed store, hash-verified

4 Returns an ID of only numbers, i.e 123456789
5*/
6export function getRandomId(length: number = 15): string {
7 // 10 to the power of length
8 const max = Math.pow(10, length);
9 return Math.floor(Math.random() * max).toString();
10}
11
12export function getRandomIdGreaterThan(min: number): string {
13 const max = Math.pow(10, min.toString().length);

Callers 15

mockDiscordAccountFunction · 0.90
mockMessageFunction · 0.90
mockServerFunction · 0.90
mockChannelFunction · 0.90
mockThreadFunction · 0.90
mockUserServerSettingsFunction · 0.90
message.test.tsFile · 0.90
channel.test.tsFile · 0.90
makeMessageWithAuthorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected