good observations.

here is a help for you... your program modified to do any size computation
in any size of memory
(so you need not look for that special machine)

https://play.golang.org/p/m03mnIP4F0E

On Wed, Feb 13, 2019 at 10:11 PM Serhat Sevki Dincer <jfcga...@gmail.com>
wrote:

> 14 Şub 2019 Per 01:58 tarihinde Michael Jones <michael.jo...@gmail.com>
> şunu yazdı:
>
>> Serhat,
>>
>> Some more ideas for you to consider: the expected number of collisions
>> for an ideal random hash, the option of "folding in" the high bits of the
>> hash rather than truncating, and finer control of operation.
>>
>> https://play.golang.org/p/92ERC4PJKAL
>>
>
> Hi Michael,
> Here with your variant:
>
> x = uint64(1<<64-59) ^ uint64(len(s))
>
> for i := len(s) - 1; i >= 0; i-- {
> x ^= uint64(s[i])
> x *= 11400714819323198549
> }
>
> // fold high bits
>
> you have a direct collision with input length's lowest byte (which is
> practically the length) and input's first byte. This is better for
> initialization:
>
> x = uint64(len(s))
> x *= 11400714819323198549
>
> at the cost of an extra multiplication.
>
> Folding high bits does not change collision characteristic, right?
> Also when the last operation is a multiplication, you don't seem to need
> it, if at all it is useful.
>
>>

-- 

*Michael T. jonesmichael.jo...@gmail.com <michael.jo...@gmail.com>*

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to