mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-13 11:56:32 +02:00
Don't claim a password is "medium" too easily
This commit is contained in:
parent
fbe19d23b7
commit
03c15af20e
@ -72,7 +72,7 @@ Item {
|
|||||||
width: row.x
|
width: row.x
|
||||||
|
|
||||||
color: {
|
color: {
|
||||||
if(item.fillLevel < 3) return "#FF6C3C"
|
if(item.fillLevel < 5) return "#FF6C3C"
|
||||||
if(item.fillLevel < 13) return "#FFE00A"
|
if(item.fillLevel < 13) return "#FFE00A"
|
||||||
return "#36B25C"
|
return "#36B25C"
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,14 @@ Item {
|
|||||||
|
|
||||||
wizard.nextButton.enabled = passwordItem.password === retypePasswordItem.password
|
wizard.nextButton.enabled = passwordItem.password === retypePasswordItem.password
|
||||||
|
|
||||||
// scorePassword returns value from 1..100
|
// scorePassword returns value from 0 to... lots
|
||||||
var strength = walletManager.getPasswordStrength(passwordItem.password);
|
var strength = walletManager.getPasswordStrength(passwordItem.password);
|
||||||
|
// consider anything below 10 bits as dire
|
||||||
|
strength -= 10
|
||||||
|
if (strength < 0)
|
||||||
|
strength = 0
|
||||||
|
// use a slight parabola to discourage short passwords
|
||||||
|
strength = strength ^ 1.2 / 3
|
||||||
// privacyLevel component uses 1..13 scale
|
// privacyLevel component uses 1..13 scale
|
||||||
privacyLevel.fillLevel = Utils.mapScope(1, 100, 1, 13, strength)
|
privacyLevel.fillLevel = Utils.mapScope(1, 100, 1, 13, strength)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user