So I’m working on this web app to generate passwords. It is my first ever attempt at building such a thing. I’m expecting it will be riddled with security holes. However, I am following secure development good practices – as best I can.
Tonight I built my first code block of JavaScript ever that did more than move an elf. My first ever exposure to JavaScript was at the 2020 Holiday Hack Challenge. Prior to that it isn’t something I’d ever done before. The fact that I have a block of code is amazing. I’m not sure if it does anything yet.
I can tell you that my html renders correctly in the browser. However, nothing happens when I click the Generate or Click me buttons.
function generatePword () {
minLength = mlength;
maxLength = nlength;
length1 = Array.from({length: maxLength});
num1 = length1.join();
parseInt(num1);
length2 = Array.from({length: minLength});
num2 = length2.join();
parseInt(num2);
r = Math.random() * (length1 – length2 + 1) + length2;
for (n=0;n<r;n++){
document.write(words(n));
}
My takeaway from this JavaScript experience:
Learning Java programming was way more useful than I ever expected it to be.
It made writing JavaScript a lot easier since the language is similar in a lot of ways. Functions are very similar. So is code structure. More of the advanced functions: like working with arrays is my next challenge in JavaScript…..but that will have to be another night!!
Staying up late to code
January 18, 2021By Kimberly Mitchell
Well I had planned on heading to bed around 9pm tonight. I’ve been tired. And there’s work tomorrow.
See the thing is though, I managed to get a start on actually writing my awesome password generating app tonight. I started writing the web app page in html and I’ve got the guts of the underlying algorithm put together.
It’s now 11pm. Yes. That is 2 hours after I had planned to sleep. I guess I’m heading there soon. My brain is mushy.
Here’s a sneak peak at the page though.

IT IS SO PRETTY!!!!
And here’s the algorithm I’m on my way to having written for the underlying code.
// ALGORITHM
// Get minimum length
// Set mlength
// let length1 = Array.from({length: maxLength}) //javascript way to create an array of length
// num = length.join(); //javascript way to make a string out of the array
// parseInt(num); //javascript way to convert from string to integer
// let length2 = Array.from({length: minLength}) //javascript way to create an array of length
// num2 = length.join(); //javascript way to make a string out of the array
// parseInt(num2); //javascript way to convert from string to integer
// Calculate r (maxlength – minlength + 1)+min
// for (i=0; i<mlength+r;i++)
// get letter from array
// print letter
Not bad for a couple of hours’ work. I might be ok at this after all.