You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the cool library - I have been using it to utitlise cryptojs to encrypt images, but it seems the jsevaluator doesn't initialise properly if the file is large enough (though it is hard to tell exactly what the issue is).
It works fine if the image is small, but if it's large (I've been testing with 0.9MB), it just doesn't return, and there are no errors. I have tried passing the data to the script in a few ways - currently it builds a 'plain' variable with the base64, but I have also tried passing the base64 directly to the encrypt function as a parameter, which causes the same behaviour.
I do not think it is a fault of the script itself, since if I replace the encrypt function with 'return "apples";' the behaviour is the same, which indicates that the function is not actually being called. Please let me know if I can provide more information!
The text was updated successfully, but these errors were encountered:
Hi @reality, I think your code is correct. As you suspected, the problem is probably the size of the JavaScript text you are evaluating. I had one person reporting similar issue before when he could not evaluate very long strings but was able to evaluate shorter ones. As you probably know, this library uses the web view to evaluate the JavaScript. I suspect that web view is choking on the large data (sorry for the horror analogy).
It looks like this library is not suitable for evaluating big things. I am putting a message on the readme about that.
Thanks for the cool library - I have been using it to utitlise cryptojs to encrypt images, but it seems the jsevaluator doesn't initialise properly if the file is large enough (though it is hard to tell exactly what the issue is).
Here is how I'm using it: https://github.com/reality/alsuti/blob/master/android/app/src/main/java/rehab/reality/alsuti/Encrypter.java - First it grabs the base64 of an image, and builds a JS script with this, cryptojs and a short encryption function.
It works fine if the image is small, but if it's large (I've been testing with 0.9MB), it just doesn't return, and there are no errors. I have tried passing the data to the script in a few ways - currently it builds a 'plain' variable with the base64, but I have also tried passing the base64 directly to the encrypt function as a parameter, which causes the same behaviour.
I do not think it is a fault of the script itself, since if I replace the encrypt function with 'return "apples";' the behaviour is the same, which indicates that the function is not actually being called. Please let me know if I can provide more information!
The text was updated successfully, but these errors were encountered: