Re: what type of hashing in scala

shashank kapoor <[email protected]> Mon, 4 Jan 2016 20:27:49 +0530
Newsgroups gmane.comp.lang.scala
Message-ID <CAEa9BTTMy759gi=qKkfA9nwHpWrJ7WXJHpru_ZoRQc_ijoN==Q@mail.gmail.com>
I was asking for AnyRef.
Thanx :)

On Mon, Jan 4, 2016 at 8:19 PM, Sébastien Doeraene <[email protected]>
wrote:

> Hi,
>
> It is unclear what you are asking. Are you talking about the default hash
> code generation in AnyRef (aka Object)? Or are you talking about the hash
> code functions generated for case classes?
>
> For case classes, the current implementation of Scala uses Murmur Hash 3.
> Although you should not rely on it, since it could change in future
> implementations.
>
> For AnyRef.hashCode, that one is platform-dependent. On the JVM, it is
> whatever the JVM decides to use (e.g., Park-Miller, as you mentioned). On
> JavaScript, the current implementation always uses sequential numbers,
> although that could change in the future. In any case, you cannot rely on
> it.
>
> Cheers,
> Sébastien
>
> On Mon, Jan 4, 2016 at 3:39 PM, shashank kapoor <
> [email protected]> wrote:
>
>> I see that there is documentation in any.scala that hashing is platform
>> dependent, but how? and I can also see murmur hash 3 in code. Help me
>> understand this.
>>
>> On Mon, Jan 4, 2016 at 5:47 PM, shashank kapoor <
>> [email protected]> wrote:
>>
>>> Hi
>>> In scala what type of hashing is used? In java it is park-miller by
>>> default. So in scala what is the default hashing algorithm?
>>>
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "scala-language" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/scala-language/t_iDssWTplU/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Regards
>> Shashank Kapoor
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "scala-language" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "scala-language" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/scala-language/t_iDssWTplU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards
Shashank Kapoor

-- 
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.