Hash

What is the purpose of string hash? What would you use it for?
EXAMPLE: “This is a test.”.hash RETURNS -649841898. WHAT EXACTLY DOES
THIS REPRESENT? WHAT IS IT GOOD FOR? COMPARISONS?

Ron G. wrote:

What is the purpose of string hash? What would you use it for?
EXAMPLE: “This is a test.”.hash RETURNS -649841898. WHAT EXACTLY DOES
THIS REPRESENT? WHAT IS IT GOOD FOR? COMPARISONS?

it has to do with Cryptography, it has nothing to do with the Hash
class, if this is what is confusing you.

http://en.wikipedia.org/wiki/Hash_function

is a general explination (not just ruby) but i see it fit good enough.
in terms of usage, well, that’s up to u, i guess.
hth

–shai

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs