Web Development

ecmaScrypt v0.03 - SHA-2 Added

I've added an open source (BSD) SHA-2 implementation. This can be used independently or to generate a key from a pass phrase (aka password). I've also changed the AES implementation to take in number arrays instead of hex strings for the key and IV.

I'm continuing forward so expect more additions and modifications. I would like to hear some feedback on its usability and bugs too.

One great feature of JavaScript is the ability to create objects through shorthand (or more precisely "object literal notion") rather than writing the full syntax of a function block and using the prototype object. This ability to use shorthand is the basis of JSON, but is also useful to making code less verbose - albeit somewhat less readable.

In a previous article, JavaScript Built-in Listeners and Memory Leaks, I described one method of wrapping built-in JavaScript DOM events into a custom event handler so listeners can be properly cleaned up to prevent memory leaks. In this article I'll describe a use of removeBuiltinListener to save you a step if you're adding and removing a lot of DOM elements which have listeners attached.

Awhile back on Digg there were a couple posts about animated sliding boxes similar to what Digg uses for its comment system.

Built-in Event Listeners, JavaScript Objects, the DOM, and Memory Leaks

As I mentioned yesterday in my article about custom event listeners, I decided to tie built-in listeners into my Event object. I did this for two reasons. The secondary reason was simply because it was easier to deal with multiple methods with similar construct within the same object.