DEV Community

Fernando Piancastelli
Fernando Piancastelli

Posted on

2 2 1 2 3

Hash Function 256 chars

This is a submission for DEV Computer Science Challenge v24.06.12: One Byte Explainer.

Explainer

A hash function takes a key or input data and maps it to a fixed-size, uniformely distributed value (hash), later used for data retrieval. It strives to be fast, only generate one possible hash per input and make key mapping possible in near constant time.

Additional Context

Hashes are hard to define because it has many similar concepts in the field, which are used almost interchangibly; it is especially hard not to confuse them with checksums - those are interested in data integrity, not mapping. Also, results uniformely distributed is an essential property to make use of the hash value constant in time, since no hash is more probable than another from the same function.
Another important distinction is to separate general hash functions to cryptographic ones: the latter takes computational effort to make a 1 to 1 mapping to input (any one input can only be represented by one hash) and to make the original input unguessable by the hash alone, among other differences.

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay