cryptico
cryptico copied to clipboard
some variable is not define && use UMD for automated build systems
Some variable and window window.navigator is not defined in Node.js. This will causes some errors.
eg.
my.pad16 = function(bytes)
{
var newBytes = bytes.slice(0);
var padding = (16 - (bytes.length % 16)) % 16;
for(i = bytes.length; i < bytes.length + padding; i++)
{
newBytes.push(0);
}
return newBytes;
}
i is not defined.
You have to declare 'i' as a variable the first time you use it.
my.pad16 = function(bytes) { var newBytes = bytes.slice(0); var padding = (16 - (bytes.length % 16)) % 16; for(var i = bytes.length; i < bytes.length + padding; i++) { newBytes.push(0); } return newBytes; }
@JDSlimz I have made a new commit. It update pad16 function