-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #2353 This adds a random suffix to the default activation key name, making it less predictable.
- Loading branch information
1 parent
4fa0ad8
commit 0ecf7c9
Showing
2 changed files
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/Components/CreateImageWizard/utilities/generateRandomId.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const generateRandomId = () => { | ||
let id = ''; | ||
const characterSet = 'abcdefghijklmnopqrstuvwxyz0123456789'; | ||
while (id.length < 6) { | ||
id += characterSet.charAt(Math.floor(Math.random() * characterSet.length)); | ||
} | ||
return id; | ||
}; |