Skip to content

Instantly share code, notes, and snippets.

@lholmquist
Last active December 28, 2015 00:39
Show Gist options
  • Save lholmquist/7415231 to your computer and use it in GitHub Desktop.
Save lholmquist/7415231 to your computer and use it in GitHub Desktop.
// this
AeroGear.crypto.getRandomValue = function() {
var random = new Uint32Array( 1 );
crypto.getRandomValues( random );
return random[ 0 ];
};
// can now be
AeroGear.Crypto = function() {
...
this.getRandomValue = function(){ ... }
...
}
// then this https://github.com/abstractj/aerogear-js/blob/b5ba4227a40985f9346db02fd523e7a05ea6c39c/src/crypto/aerogear.crypto.js#L18
// can be a local variable
// Local Variables
var privateKey, publicKey, IV;
// and then https://github.com/abstractj/aerogear-js/blob/b5ba4227a40985f9346db02fd523e7a05ea6c39c/src/crypto/aerogear.crypto.js#L75 could be simplified, perhaps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment