Force first character to upper case to meet a standard rule.

This commit is contained in:
Andrew Tomaka 2011-12-12 16:59:47 -05:00
parent 43fd5ec787
commit 3acdcf9e08

View file

@ -52,13 +52,20 @@
$('button').corner('round 4px');
$('#box').corner('round bottom');
//queroy.autocomplete to / ajax / etc.
$('#generate input').change(function() {
if($('#root').val() in special) {
$('#password').val(special[$('#root').val()]($.md5($('#root').val() + $('#master').val())));
var root = $('#root').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 {
$('#password').val($.md5($('#root').val() + $('#master').val()));
$('#password').val(hash);
}
});