Enter Password Length:

New Password


Old Passwords

(Client-side only - will clear automatically)

Password Length TimeStamp


var Countersign = function (length, context) {
    if (!isNaN(length)) {
        var generated = "";
        while (generated.length < length && length > 0) {
            var 
                r = Math.random(),
                p = Math.random(),
                specialChars = [33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 62, 63, 64, 91, 92, 93, 94, 95, 96, 123, 124, 125, 126];

            if (0 <= p && p < .25) {
                generated += (r < 0.1 ? Math.floor(r * 100) : String.fromCharCode(Math.floor(r * 25) + 65));
            } else if (.25 <= p && p < .5) {
                generated += (r < 0.1 ? Math.floor(r * 100) : String.fromCharCode(Math.floor(r * 25) + 97));
            } else if (.5 <= p && p < .75) {
                generated += (String.fromCharCode(Math.floor(specialChars[Math.floor(Math.random() * specialChars.length)])));
            } else if (.75 <= p) {
                generated += (r < 0.1 ? Math.floor(r * 100) : String.fromCharCode(Math.floor(r * 9) + 48));
            }
        }
        Callback(length, context, generated);
    }
}

var Callback = function (length, context, generated) {

    var place = document.getElementById(context),
        now = new Date();

        place.insertAdjacentHTML('afterbegin', "<br><b>Password: </b> <span style='color:red'>" + generated + "</span><br><br><b>Generated at: </b> " + now);

         $("#previousPW").append(
            '<tr>' +
            '<td>' + generated + '</span></td>' +
            '<td>' + length + '<td>' +
            '<td>' + now + '</td>' +
        '</tr>');
}


Material Design Demo: Here
Repo: Git