Author Archives: thiscouldbebetter

Demonstrating the RSA Algorithm in JavaScript

The JavaScript code below picks two random two-digit primes, uses them to generate a RSA keypair, then uses that keypair to encrypt and decrypt a simple message. It uses the LargeInteger class introduced in a previous post to handle the … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

A Sliding Tile Puzzle in JavaScript

The code below implements a simple sliding tile puzzle in JavaScript. To see it in action, copy it into an .html file and open that file in a web browser that runs JavaScript. Use the arrow keys to move the … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

A Multiple Text Document Editor in JavaScript

Below is a multiple text document editor implemented in JavaScript. To see the code in action, copy it into an .html file and open that file in a web browser that runs JavaScript. Or, for an online version, visit https://thiscouldbebetter.neocities.org/multipletextdocumenteditor.html.

Posted in Uncategorized | Tagged , , | Leave a comment

A Word-for-Word Inline Translation Utility in JavaScript

The JavaScript program below, when run, prompts the user for a passage to be translated into a foreign language and a dictionary that provides translations, then presents the translated text interleaved with the original text. The translation is word-for-word, which … Continue reading

Posted in Uncategorized | Tagged , , , | 1 Comment

Simulating Hardware in VHDL Using GHDL

Follow the steps below to create a simple “Hello, World” program in VHDL using GHDL. VHDL, or “VHSIC Hardware Description Language”, is a programming language used to simulate the operation of computer hardware in software. ┬áIt provides a standardized method … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

Exploring the PNG Image File Format with a PNG Viewer in JavaScript

The JavaScript program below, when run, prompts the user to upload a PNG file and displays that image. To see the code in action, copy it into an .html file and open that file in a web browser that runs … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Decompressing Data with the DEFLATE Algorithm in JavaScript

The code below, when run, prompts the user to upload a compressed file in GZIP format, which will then be uncompressed, and the uncompressed data will be displayed both as hexadecimal digits and as UTF8 text. This implementation of DEFLATE … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment