MCPcopy Create free account
hub / github.com/ShouChenICU/FastSend / genRandomString

Function genRandomString

app/utils/index.ts:58–66  ·  view source on GitHub ↗
(length: number)

Source from the content-addressed store, hash-verified

56 * @returns
57 */
58export function genRandomString(length: number): string {
59 const charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
60 let randomString = ''
61 for (let i = 0; i < length; i++) {
62 const randomIndex = Math.floor(Math.random() * charset.length)
63 randomString += charset.charAt(randomIndex)
64 }
65 return randomString
66}
67
68/**
69 * 选择头像图片

Callers 1

setNicknameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected