(length: number = 10)
| 8 | * @link http://stackoverflow.com/a/1349426/3443137 |
| 9 | */ |
| 10 | export function randomToken(length: number = 10): string { |
| 11 | let text = ''; |
| 12 | |
| 13 | for (let i = 0; i < length; i++) { |
| 14 | text += COUCH_NAME_CHARS.charAt(Math.floor(Math.random() * COUCH_NAME_CHARS.length)); |
| 15 | } |
| 16 | |
| 17 | return text; |
| 18 | } |
| 19 | |
| 20 | |
| 21 | /** |
no outgoing calls