bloc icon indicating copy to clipboard operation
bloc copied to clipboard

refactor(bloc): calculate composite object hashes through `Object.hashAll`

Open purplenoodlesoop opened this issue 3 years ago • 3 comments
trafficstars

Hi!

In Dart version 2.14 class Object obtained a new static method – hashAll.

It is a recommended method of computing a hash of multiple objects since the bitwise XOR (^) is symmetric and is not secure.

There are two places where bitwise XOR is used to combine hashes: here and here.

The package's current minimal version is 2.12, but I think that it's worth keeping in mind for the future.

purplenoodlesoop avatar Dec 23 '21 23:12 purplenoodlesoop

Hey @purplenoodlesoop 👋 Thanks for opening an issue!

I’m aware of this but didn’t think it’s worth bumping the sdk constraint to 2.14 just for this change since this implementation has been untouched for a while now.

If we have a better reason to upgrade to Dart 2.14 then we can make this change as well but for now I’d prefer to leave it as is unless you’re running into specific issues.

Let me know what you think and thanks again!

felangel avatar Dec 24 '21 01:12 felangel

I’m aware of this but didn’t think it’s worth bumping the sdk constraint to 2.14 just for this change since this implementation has been untouched for a while now. If we have a better reason to upgrade to Dart 2.14 then we can make this change...

Oh, I totally agree with the fact that it is not worth bumping the minimal version only because of this static method, as I stated in the original issue, "I think that it's worth keeping in mind for the future." :)

purplenoodlesoop avatar Dec 24 '21 01:12 purplenoodlesoop

I realise it's not a high priority issue, but I noticed that a couple of other 'fundamental' packages are already >= 2.14, for example:

so probably it wouldn't break too many apps :)

PawlikMichal25 avatar Apr 07 '22 19:04 PawlikMichal25