regenerate random password, some layout changes
This commit is contained in:
15
src/stores/functions/generatePassword.js
Normal file
15
src/stores/functions/generatePassword.js
Normal file
@@ -0,0 +1,15 @@
|
||||
export function generatePassword() {
|
||||
//Creates a unique id for each chat bubble so that the animation can be triggered
|
||||
|
||||
var random = "";
|
||||
var possible = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP0123456";
|
||||
|
||||
for (var i = 0; i < 16; i++)
|
||||
random += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
|
||||
while(true) {
|
||||
if(!document.getElementById(random)) {
|
||||
return random;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user