In the first part of this series of articles, we have a perceptual understanding. NET, several commonly used hash encryption. Although these powerful code fragments can solve your current hash task, but it is not conducive to late maintenance. Well, let's get them together, it's time to dress them up.
The hash algorithm mentioned in part of the article is: md5,sha1,sha256,sha384,sha512. 5 algorithms, but the functionality is consistent: the input data is hashed. Well, we abstract an interface Ihash, which provides a method hash (), so that we have a uniform term "ihash" for these 5 algorithms. Let's take a look at them now:
Now we have solved the problem of address, so that we are not afraid of being unable to remember the name and can not find people. Let's quickly assign a lead to them and start working on them. For Ihash, they have to do 2 kinds of work: hash a thing, verify a thing. To save money, we don't need CTO-level leads to manage our ihash, we just need to find a ihash head. You know, O (∩_∩) o haha ~.
After a lot of auditions, I finally found this guy, let's take a look at it: