On Thu, Oct 7, 2010 at 2:54 PM, Jim Burgess <jack.zelig / gmail.com> wrote:
> I have a large array and want to calculate its hash-code using
> Array#hash.
>
> i.e. ["a","b","c"].hash
>
> I want to store this hash-code in a database table.
>
> Can anyone tell me (or point me in the right direction to find out), the
> maximum length (in characters) of such a hash-code.
>
> On my development machine the hash-code is always small enough to fit
> into a int(11) field, but I don't know what factors influence its
> calculation.
>
> Thanks in advance.

This:
http://ruby-doc.org/core/classes/Array.html#M002159

says that Array#hash returns a Fixnum, and this:

http://ruby-doc.org/core/classes/Fixnum.html#M001079

Tells you the size in bytes of a Fixnum in your platform.

Jesus.