Method: Array#hash

Defined in:
array.c

#hashInteger

Returns the integer hash value for self.

Two arrays with the same content will have the same hash value (and will compare using eql?):

['a', 'b'].hash == ['a', 'b'].hash # => true
['a', 'b'].hash == ['a', 'c'].hash # => false
['a', 'b'].hash == ['a'].hash      # => false

Returns:



5346
5347
5348
5349
5350
# File 'array.c', line 5346

static VALUE
rb_ary_hash(VALUE ary)
{
    return rb_ary_hash_values(RARRAY_LEN(ary), RARRAY_CONST_PTR(ary));
}