Sign in
Log inSign up
How JavaScript uses hashing

How JavaScript uses hashing

Seun Ogundele's photo
Seun Ogundele
·Feb 5, 2021·

2 min read

What is Hashing ?

Hashing is the process of converting a given key into another value, Its used to generate the new value according to a mathematical algorithm. Hashing can also be used for version control

Hashing is also used in data encryption. Passwords can be stored in the form of their hashes so that even if a database is breached, plaintext passwords are not accessible

Hash table and its benefits

Hash table is a type of data structure that stores key-value pairs. The key is sent to a hash function that performs arithmetic operations on it. The result is the index of the key-value pair in the hash table.

Hash tables provide the best data structure for a large amount of data. Besides having an average space complexity of O(n), hash tables have a time complexity of O(1).

Hashing and Encryption , What is the difference ?

I already explained hashing, its uses and benefits but iterate hashing is the process of converting a given key into another value, hashing take a a key and generate a entirely new value depending on the algorithm you used for the hashing but Encryption is a method of protecting data that is stored on a device or sent from one device to another, your data does not change in the process but protected from outside attack and the receiver will get the same data

What is Map objects ? and How is it implemented in Javascript ?

Map objects are collections of key/value pairs where both the keys and values may be random, A map cannot contain duplicate keys: Each key can map to at most one value

Map is a data collection type (in a more fancy way — abstract data structure type), in which, data is stored in a form of pairs, which contains a unique key and value mapped to that key. And because of the uniqueness of each stored key, there is no duplicate pair stored while objects may be defined as an unordered collection of related data, of primitive or reference types, in the form of “key: value” pairs