gmpassos / argon2

Pure Dart Argon2 algorithm (the winner of the Password Hash Competition 2015) for all Dart platforms (JS/Web, Flutter, VM/Native).
Apache License 2.0
9 stars 1 forks source link

Does not work on JS/Web platform? #1

Open hpoul opened 3 years ago

hpoul commented 3 years ago

When I understand the README.md correctly, this package be working when compiled to javascript and used on the web?

for all Dart platforms (JS/Web, Flutter, VM/Native).

but when trying to run the tests on chrome:

➜  argon2 git:(master) pub run test -p chrome 
Precompiling executable... (10.4s)
Precompiled test:test.
00:02 +0: compiling test/argon2_test.dart                                                                                                                                              
lib/src/argon2_base.dart:61:27:
Error: The integer literal 0xFFFFFFFFFFFFFFFF can't be represented exactly in JavaScript.
  static const int M32L = 0xFFFFFFFFFFFFFFFF;
                          ^^^^^^^^^^^^^^^^^^
lib/src/argon2_extension.dart:73:15:
Error: The integer literal 0xFFFFFFFFFFFFFFFF can't be represented exactly in JavaScript.
            ((0xFFFFFFFFFFFFFFFF) ^ ((1 << (64 - count)) - 1));
              ^^^^^^^^^^^^^^^^^^
Error: Compilation failed.
BitPampers commented 2 years ago

Same here. Any activity in this repository to maybe fix this? Or at least remove the web compatibility misleading mention from the description and pub.dev

gmpassos commented 2 years ago

This implementation of Argon2 was incorporated into Pointycastle:

https://pub.dev/packages/pointycastle

In the last version they have implemented support for JS/Web/Browser computation.