A Gentle Explanation of Hash Functions

How to crack passwords and speed up your code, all with the power of hashing.

Jasmine Webb
The Startup

--

Hashing is an important topic for programmers and computer science students to be familiar with. This article is specifically targeted to students, and programmers with a few months to a year of coding experience.

What Hashing Is

Hashing: generating a value or values from a string using a mathematical function

Hashes are mostly used for three things:

  1. Storing stuff without actually knowing what it is
  2. As a convenient way to remember where you put something
  3. To make sure the thing you received is the thing you wanted

That’s super confusing but bear with me.

How it works

Hashing is otherwise described as doing a non-reversible operation on a thing that turns it into a completely different thing but would turn into the same thing if you did it again with the same input.

It’s a bit like hard boiled eggs. You can’t un-boil an egg, but you know what you’ll get out if you put a raw egg in some boiling water for 6-8 minutes. In much the same way, you can’t un-hash something.

--

--