From 3acdcf9e08dafdd622d756ee824cfa4e9ebe51fd Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Mon, 12 Dec 2011 16:59:47 -0500 Subject: [PATCH] Force first character to upper case to meet a standard rule. --- index.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index aac93ae..ba6dcf5 100755 --- a/index.php +++ b/index.php @@ -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); } });