官术网_书友最值得收藏!

Understanding the SHA256 hashing function

The SHA256 hashing function takes in any string of text, hashes that text, and returns a fixed-length hashed string.

To get a better understanding of what hash data looks like, visit https://passwordsgenerator.net/sha256-hash-generator/. This is a hash generator. If you input any text into the text box, you will get hash data as the output.

For example, if we put CodingJavaScript into the textbox, the hash that is returned to us will look like the one highlighted in the following screenshot: 

The output hash that we can observe in the preceding screenshot seems arbitrary, and thus helps in keeping the data safe. This is one of the reasons why SHA256 hashing is so secure. 

Now, if we add another character to our input string or if we change our input string in any way, the entire output hash will change completely. For example, if we add an exclamation mark at the end of our input string, the output hash will entirely change. You can observe that in the following screenshot: 

You can try experimenting by adding new characters at the end of the input string. You'll observe that as we add more or remove the characters, the entire output hash will change drastically every time, thus generating the new random patterns. 

One other thing that you may want to observe related to SHA256 hashing is that with any given input, the output will always be the same. For example, for our input string, codingJavaScript!, you will always get the same hash output that was shown in the previous screenshot. This is another very important feature of SHA256 hashing. With any given input, the output or the hash that is returned from that input will always be the same.

So, this is how SHA256 hashing works. In the next section, we'll implement the SHA256 hashing function inside of our hashBlock method.

主站蜘蛛池模板: 梧州市| 绥芬河市| 旅游| 盐源县| 南丹县| 荥阳市| 莱芜市| 临江市| 德令哈市| 绥江县| 商水县| 昌宁县| 苏尼特右旗| 石河子市| 玛多县| 文登市| 瓦房店市| 津市市| 楚雄市| 临江市| 樟树市| 合川市| 定州市| 汉阴县| 乌海市| 万年县| 大新县| 苍山县| 安远县| 浦北县| 泊头市| 承德县| 武清区| 巴彦县| 西乌珠穆沁旗| 雅江县| 宁晋县| 邢台市| 东乡族自治县| 开鲁县| 改则县|