Skip to content

Web implementation of hashValues can overflow when given too many inputs #50651

@jason-simmons

Description

@jason-simmons

The version of hashValues in lib/web_ui/build/packages/ui/src/ui/hash_codes.dart combines hash values by repeatedly multiplying a running total by a constant and then adding the next value. This can result in overflow if hashValues is given a large number of inputs.

When the underlying JavaScript number overflows it saturates to infinity. This causes hashValues to return the same infinity value for different inputs, resulting in an ineffective hash.

@yjbanov @ferhatb

Metadata

Metadata

Assignees

Labels

platform-webWeb applications specifically

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions