lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


So, if I wanted a numeric hash for a table (or i assume any of the other reference types) I could simply pass the result of %p formatting into FNV1-a say?

On Wed, Apr 28, 2021 at 2:11 PM Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> However, long strings can have multiple copies inside Lua, so equal
> strings can have different addresses.

  > string.format("%p  %p", string.rep("x", 40), string.rep("x", 40))
  0x55a34f26acc0  0x55a34f26acc0
  > string.format("%p  %p", string.rep("x", 41), string.rep("x", 41))
  0x55a34f26b1b0  0x55a34f26b200

-- Roberto