DEV Community

Cover image for How JavaScript uses hashing
thabang21
thabang21

Posted on

How JavaScript uses hashing

What is hashing and what is it used for

  • Hashing is the process of converting a given key into another value.
  • Hashing is used for authentication.

What a hash table is and what the benefits of this data structure are:

  • hash table (hash map) is a data structure that implements an associative array abstract data type, a structure that can map keys to values.

Benefits of hash table

  • Hash tables are data structures that make finding data a lot quicker

  • Hash tables are more efficient than search trees or any other table lookup structure

Difference between hashing and encryption

  • Encryption: Reversible transformation of data format, used to preserve usability of data.
  • Hashing: Is a one-way summary of data, cannot be reversed, used to validate the integrity of data

What is map object

The Map object holds key-value pairs and remembers the original insertion order of the keys.

Comparison between objects and maps:

Map:
  • A Map's keys can be any value (including functions, objects, or any primitive).

  • The number of items in a Map is easily retrieved from its size property.

Object:
  • The keys of an Object must be either a String or a Symbol.
  • The number of items in an Object must be determined manually.

Reference:

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

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

Okay