Skip to content

hash improvements #5804

Open
Open

Description

@ab9rf
  • add a hasher for df::coord2d
  • provide a binding so Lua code can obtain hash values for objects that are hashable

Activity

  1. SilasD commented on May 14, 2026

    @SilasD
    Contributor

    Note that Lua uses 64-bit integers, so will prefer a 64-bit hash.
    I think that map coordinates are always less than 1024,
    (in a 16x16 map, x and y can be 0..767)
    so can be stuffed into a 32-bit hash with e.g. (x << 20) & (y << 10) & z
    as long as it's guaranteed that none of those are negative, I guess.
    ((x & 0x3FF) << 20 & ((y & 0x3FF) << 10) & (z & 0x3FF), maybe.

  2. ab9rf commented on Sep 20, 2026

    @ab9rf
    MemberAuthor

    #5961 addresses the first half of this
    the second half will probably have to wait until #5959 is merged since it will need to be capability-based which our current identity system does not support well, but the one in #5959 handles much more readily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions