in reply to Re^7: can I change hash keys or values directly
in thread can I change hash keys or values directly

OK, Sorry I was under the impression you were showing parts of Perl's implementation ...

... and this raised some security doubts.

It also surprised me to see that the address to the key is hashed and not the string of the key.

Cause this has some implications.

Anyway ...

Thanks for the enlightening conversation! :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^8: can I change hash keys or values directly

Replies are listed 'Best First'.
Re^9: can I change hash keys or values directly
by Marshall (Canon) on Feb 08, 2021 at 20:30 UTC
    The first hashing algorithm WAS Perl's implementation more than decade ago. It is more complex now, but I'm sure that it is still very, very fast.

    Again this code is NOT Perl. But it does use Perl concepts. I am sorry if this more confusing than helpful.

    It also surprised me to see that the address to the key is hashed and not the string of the key.
    There is a misunderstanding here - perhaps caused by some C misunderstanding? The address to the key is not hashed. A binary memory address "IS the key". In Perl, a hash key must (or used to be) be ascii. In version 1, I converted this binary hash key to ascii to run the Perl algorithm upon it. The second algorithm doesn't convert the binary value to ASCII and uses just binary operations directly.

    We are getting way "off topic" if we talk about 68000 vs modern Intel/AMD processors. I worked at one time with Bob Childs, who invented the Intel 286 memory segmentation stuff to make it compatible with what Intel could do within the limits of backward compatibility etc. Bob was a very smart, albeit argumentative guy. I miss him.