Force first character to upper case to meet a standard rule.
This commit is contained in:
parent
43fd5ec787
commit
3acdcf9e08
1 changed files with 11 additions and 4 deletions
15
index.php
15
index.php
|
@ -52,13 +52,20 @@
|
||||||
$('button').corner('round 4px');
|
$('button').corner('round 4px');
|
||||||
$('#box').corner('round bottom');
|
$('#box').corner('round bottom');
|
||||||
|
|
||||||
//queroy.autocomplete to / ajax / etc.
|
|
||||||
|
|
||||||
$('#generate input').change(function() {
|
$('#generate input').change(function() {
|
||||||
if($('#root').val() in special) {
|
var root = $('#root').val();
|
||||||
$('#password').val(special[$('#root').val()]($.md5($('#root').val() + $('#master').val())));
|
var master = $('#master').val()
|
||||||
|
var hash = $.md5(root + master);
|
||||||
|
|
||||||
|
hash = hash.replace(/[a-f]/, function(alpha) {
|
||||||
|
return alpha.toUpperCase();
|
||||||
|
});
|
||||||
|
|
||||||
|
if(root in special) {
|
||||||
|
$('#password').val(special[root](hash));
|
||||||
} else {
|
} else {
|
||||||
$('#password').val($.md5($('#root').val() + $('#master').val()));
|
$('#password').val(hash);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue