mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Simplify loop to write bytes to password
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
4c8007e461
commit
9df47cf1cc
1 changed files with 3 additions and 4 deletions
|
@ -63,10 +63,9 @@ QString createRandomPassword()
|
|||
|
||||
RAND_bytes(unsignedCharArray.data(), numChars);
|
||||
|
||||
for (auto i = 0; i < numChars; i++) {
|
||||
auto byte = unsignedCharArray[i];
|
||||
byte %= asciiRange + 1;
|
||||
byte += asciiMin;
|
||||
for (const auto newChar : unsignedCharArray) {
|
||||
// Ensure byte is within asciiRange
|
||||
const auto byte = (newChar % (asciiRange + 1)) + asciiMin;
|
||||
passwd.append(byte);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue