ws2801-client
Version:
A client for the webserver for the WS2801-Pi module.
12 lines (9 loc) • 386 B
text/typescript
export function generateId(idLength: number): string {
let result: string = '';
const characters: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const charactersLength: number = characters.length;
for ( let i: number = 0; i < idLength; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}