Closed kobreu closed 1 month ago
Hi,
I noticed that the FNV Hashing doesn't work on Flutter web. The problem is in this line of gb_utils.dart:
final int mod32 = 1 << 32; // Equivalent to 2^32
on web this evaluates to 0 as on web shift operators operate on 32-bit integers (see here: https://stackoverflow.com/questions/307179/what-is-javascripts-highest-integer-value-that-a-number-can-go-to-without-losin)
The fix would be to change the line to
final int mod32 = 0x100000000; // Equivalent to 2^32
Best regards,
Korbinian
Hi, @kobreu. Thank you for mentioning that. You're right, we will add this change to our next release.
Hi, @kobreu. Here is al link to pull request with fix.
Great, thanks!
Hi,
I noticed that the FNV Hashing doesn't work on Flutter web. The problem is in this line of gb_utils.dart:
on web this evaluates to 0 as on web shift operators operate on 32-bit integers (see here: https://stackoverflow.com/questions/307179/what-is-javascripts-highest-integer-value-that-a-number-can-go-to-without-losin)
The fix would be to change the line to
Best regards,
Korbinian