Hashing Table


Hashing

   A hash is a function that converts an input of letters and numbers into an encrypted output of a fixed length.


Key Takeaways :

    • A hash is a function that meets the encrypted demands needed to solve for a blockchain computation.
    • A hash, like a nonce or a solution, is the backbone of the blockchain network.
    • Hashes are of a fixed length since it makes it nearly impossible to guess the length of the hash if someone was trying to crack the blockchain.
    • A hash is developed based on the information present in the block header.


Hasil gambar untuk hashing



   Hashing requires processing the data from a block through a mathematical hash function, which results in an output of a fixed length. Using a fixed-length output increases security since anyone trying to decrypt the hash won’t be able to tell how long or short the input is simply by looking at the length of the output.Solving the hash starts with the data available in the block header and is essentially solving a complex mathematical problem. Each block header contains a version number, a timestamp, the hash used in the previous block.

Hash Function

   Hashing is used with a database to enable items to be retrieved more quickly. Hashing can also be used in the encryption and decryption of digital signatures. The hash function transforms the digital signature, then both the hash value and signature are sent to the receiver. The receiver uses the same hash function to generate the hash value and then compares it to that received with the message. If the hash values are the same, it is likely that the message was transmitted without errors.
Hasil gambar untuk hash function

Hash Table

   Hash table is a data structure that represents data in the form of key-value pairs. Each key is mapped to a value in the hash table. The keys are used for indexing the values/data. A similar approach is applied by an associative array.
Limitations of a Hash Table :
  • If the same index is produced by the hash function for multiple keys then, conflict arises. This situation is called collision.
    To avoid this, a suitable hash function is chosen. But, it is impossible to produce all unique keys because |U|>m. Thus a good hash function may not prevent the collisions completely however it can reduce the number of collisions.
Hashing Implementation in Blockchain

Hashing is applied in blockchain, Here are more examples.

    • Addresses on the blockchain are derived from hashing e.g. Bitcoin addresses use SHA2-256 and RIPEMD 160.
    • Hashing helps in defining cryptographic signatures that help determine valid transactions.
    • The hash of a transaction makes it easy to keep track of transactions on the blockchain. Instead of looking for a transaction that was the “1030th in block 14573”, it is easier just to copy the hash into a blockchain explorer from where you can view the transaction details.
    • Hashing functions are crucial in crypto mining where a valid nonce is discovered by computing several hashes. This helps to form a consensus on the blockchain.
    • The use of “hash of the data” helps to store large amounts of data on the blockchain. This data is time-stamped and can be hashed for future reference. It makes the permanent data storage less bulky or simply more economical.
    • Hashrate- determining how fast and smoothly-running the mining process is. It is vital in determining difficulty levels during mining.

Comments

Popular posts from this blog

AVL Tree & B Tree

Binary Tree

Data Structure Summary