Ruby: Hash Code

intro

  • hash code is not Hash key-value data structure.
  • hash code is usually a short identifier of an object.
  • the short identifier is usually a numeric value, so it is faster.
  • eql?() method compare with two objects' hash codes.
  • hash() method return the object's hash code.
  • better overwrite ==, hash, and eql? methods.
  • Array#uniq, Hash#lookups compare with hash code.

你可能感兴趣的:(Ruby: Hash Code)