Skip to content

Should we have Java-like hash codes? #16

@neocotic

Description

@neocotic

When I first decided to create Nevis, I really wanted to see if I could recreate Javas hashCode, equals, and toString methods in JavaScript. I even went as far as to try and get the resulting hash codes as close as possible. However, the Java hashCode implementation can only return a 32-bit signed integer. Basically, it has a much smaller maximum value than an integer in JavaScript and, since hashCodes can generally be very large numbers, Java squeezes them down to fit into a 32-bit signed integer.

My question is; should we try to do the same, as we are now, or simply use the larger values? What are the pros and cons?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions