Closed mattmaddux closed 3 years ago
Ok, this is a problem.
Integers are limited to include all integers between -2^53 and 2^53 when compiled to JS.
Given the argon2 implementation relies on Uint64List it will be impossible for it to build a correct result on JS.
Thoughts?
MW
A few options:
I have the same problem!
Update:
I have dealt with the compilation issue but blindly releasing that would hide a bigger issue of integer mal-representation on platforms that only support IEEE 754 double precision numbers that cannot safely represent for example, positive integers > 9007199254740992.
I am in the process of applying a platform specific assertion to the transformations that fail their tests when running on "chrome" pub run test -p chrome
after examining why they fail and if the failure is related integer representation.
I'll keep you posted.
MW
Ok,
I have pushed to master code that will compile on web, Argon2 and Poly1305 will now assert that they have access to a full 64bit integer.
I would appreciate it if people wouldn't mind building the master branch and running the tests.
VM:
pub run test -r expanded
JS:
pub run test -p chrome -r expanded
Let me know how you go, I would be interested to know how much of this library is being used in the JS environment.
It will go out as 3.2.0 as there is a breaking change in function over the next 24 hours.
MW
I would be interested to know how much of this library is being used in the JS environment
FYI, Personally I use it in a node environment (firebase cloud function, alibaba function compute)! I know that is not a standard usage...I encountered the same issue. I also use it for testing in flutter projects, and it fails for flutter web too.
I tried on the latest master branch:
pub run test -p node
pub run test -p chrome
Both failed. Some new implementation could be removed from js (if too complex to implement) using conditional import
I would be interested to know how much of this library is being used in the JS environment.
I'm using web3dart. it would be ideal to work in browsers
Ok I have pushed another update to master.
The issue on node js was dart not being able to find a source of entropy, I have added logic to call node's crypro library.
On my machine (osx) and on our CI (Ubuntu linux) using, I can get all the tests to pass. (Node v12.6.0, Dart 2.13.1)
pub run test
pub run test -p chrome
pub run test -p node
Let me know how you go.
Let me know how you go.
It works for me too, great!
Please release.
Please release,I have the same problem.
Hi, when can we expect the new release v3.2.0. I am facing the same issue from yesterday.
@ArpanaSwarnkar If you need to get going now and you don't need to use Argon2, you can list version 3.1.1 directly in your pubspec.yaml and it will build to JS and run just fine.
Attempting to build for web throws the following errors:
Here's another issue with same base problem: https://github.com/Naddiseo/dart-sprintf/issues/13