Hashing: Difference between revisions

From Computer Science Wiki
No edit summary
Line 1: Line 1:
[[file:computation.png|right|frame|Computational thinking, problem-solving and programming<ref>http://www.flaticon.com/</ref>]]
[[file:computation.png|right|frame|Advanced programming<ref>http://www.flaticon.com/</ref>]]


A hash function is any function that can be used to map data of arbitrary size to fixed-size values. The values returned by a hash function are called hash values, hash codes, digests, or simply hashes. The values are used to index a fixed-size table called a hash table. Use of a hash function to index a hash table is called hashing or scatter storage addressing.<ref>https://en.wikipedia.org/wiki/Hash_function</ref>
A hash function is any function that can be used to map data of arbitrary size to fixed-size values. The values returned by a hash function are called hash values, hash codes, digests, or simply hashes. The values are used to index a fixed-size table called a hash table. Use of a hash function to index a hash table is called hashing or scatter storage addressing.<ref>https://en.wikipedia.org/wiki/Hash_function</ref>

Revision as of 14:26, 8 March 2020

Advanced programming[1]

A hash function is any function that can be used to map data of arbitrary size to fixed-size values. The values returned by a hash function are called hash values, hash codes, digests, or simply hashes. The values are used to index a fixed-size table called a hash table. Use of a hash function to index a hash table is called hashing or scatter storage addressing.[2]

Hashing is the transformation of a string of characters into a usually shorter fixed-length value or key that represents the original string. Hashing is used to index and retrieve items in a database because it is faster to find the item using the shorter hashed key than to find it using the original value. It is also used in many encryption algorithms.[3]

Hashing.png

Simple Code sample[edit]

# this python file should be used as part of your process to understand hashing. 
# please change values so you can see how hashing works! 

myString = "Hello there"
print("Before Hash: ", myString)

myHashedString = hash(myString)
print("After Hash: ", myHashedString)

Videos[edit]

This video will give you a general introduction to hashing.

The video below helps us understand hashing within the context of blockchain.

References[edit]