Syntax idea: Constructors

This might be a simple question, but I wanted to see what the group's thoughts are.  

Right now, a lot of the API is devoted to createFoo() methods.  Is there any reason for these not to just be constructors for new object types?  For example:

OLD: var d = window.crypto.createDigester("sha256");
NEW: var d = new Digest("SHA-256");

It doesn't really seem like the various operations are sharing any resources, so they don't really need to be tied back to the master Crypto interface. 

Humbly submitted,
--Richard

Received on Tuesday, 11 December 2012 14:04:29 UTC