I made a script that loads a file and decrypts it.
Generally works without problems.
Only a few times once I start browers, I get this error:
Error: TypeError: pidCrypt.AES.CTR is not a constructor
Do it is a timeout problem?
How to solve?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The error means that your script is trying to call a constructor that isn't known at that point.
Resaons for this could be
there was a runtime error somewhere in your javascript
there is problem with the sequence in your code, i.e. the constructor is called before the libraries are available
the conditions in the definition of the constructor if(typeof(pidCrypt) != 'undefined' && typeof(pidCrypt.AES) != 'undefined') aren't fulfilled
Please make sure that pcrypt.js, pidcrypt_util.js and aes_core.js are loaded before aes_ctr.js and all of them are loaded before calling the constructor.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I made a script that loads a file and decrypts it.
Generally works without problems.
Only a few times once I start browers, I get this error:
Error: TypeError: pidCrypt.AES.CTR is not a constructor
Do it is a timeout problem?
How to solve?
The error means that your script is trying to call a constructor that isn't known at that point.
Resaons for this could be
if(typeof(pidCrypt) != 'undefined' && typeof(pidCrypt.AES) != 'undefined')
aren't fulfilledPlease make sure that
pcrypt.js
,pidcrypt_util.js
andaes_core.js
are loaded beforeaes_ctr.js
and all of them are loaded before calling the constructor.I tried also:
while(typeof pidCrypt === 'undefined' && typeof pidCrypt.AES === 'undefined' && typeof pidCrypt.AES.CTR === 'undefined'){}
var aes = new pidCrypt.AES.CTR();
but not solve.
I will try
while(typeof pidCrypt === 'undefined' || typeof pidCrypt.AES === 'undefined' || typeof pidCrypt.AES.CTR === 'undefined'){}
Last edit: Mario Pilesi 2013-05-30
I tried but when it happens it hang.
Last edit: Mario Pilesi 2013-05-31