Hashing is the transformation of a string of characters into a generally shorter fixed-length key or a value that presents the original string. Hashing is used to index and retrieve values in a database because it is faster to search the item using the shorter hashed value than to search it using the original value. It is also used in many encryption operations.