A Hash is a one-way math function that takes input and provides reproducible output.
Hash is often used to identify data that is not identifiable by itself, so if you compute a hash on a data block, that data should always create the same hash. one example is passwords. when you register on the site, they save the hash of your password using an algorithm. when you log in, you send your password to a site that hashes it using the same algorithm that they used to store it. if the two hash values โโmatch, then you entered the correct password.
if the object modifies the computed hash will be different. this is often important for checking data. if I use sha1 to hash the string "Frank" at 123456789 (just an example), and I send the data to them along with the hash, they can perform the same hash and see if the values โโmatch. if my bits are mixed up when sending and they get a โBrankโ when they calculate the hash, it will not be 123456789 and they know that the data was corrupted when sending.
Using NewGuid , you simply generate a random number that is not related to the original data. it cannot be reproduced, so all the above examples would not be possible. the hash algorithm should always provide the same output for the same input, and it should also try to prevent any other input from being created for the same output.
Hope that helps
source share