<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sprintf on Gopher Coding</title><link>https://gophercoding.com/tags/sprintf/</link><description>Recent content in Sprintf on Gopher Coding</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Sun, 02 Apr 2023 12:13:48 +0100</lastBuildDate><atom:link href="https://gophercoding.com/tags/sprintf/index.xml" rel="self" type="application/rss+xml"/><item><title>SHA3 Hash in Golang (256-bit)</title><link>https://gophercoding.com/sha3-encode-in-golang/</link><pubDate>Sun, 12 Feb 2023 09:30:00 +0000</pubDate><guid>https://gophercoding.com/sha3-encode-in-golang/</guid><description>&lt;p>You can use the &lt;code>golang.org/x/crypto/sha3&lt;/code> [&lt;a href="golang.org/x/crypto/sha3">docs&lt;/a>] package to perform SHA-3 encoding on a string. We have an example function below, it will take your string and write it as a hash. Then convert that binary back into a hexadecimal string using &lt;code>Sprintf&lt;/code>.&lt;/p>
&lt;h2 id="advantages-of-using-sha3">Advantages of Using SHA3&lt;/h2>
&lt;ol>
&lt;li>
&lt;p>&lt;strong>Security&lt;/strong>: SHA-3 was designed to provide higher security compared to SHA-2 by using a different construction called &amp;ldquo;sponge construction&amp;rdquo;, which makes it more resistant to various types of attacks, such as collision and preimage attacks.&lt;/p></description></item><item><title>MD5 Encoding in Golang</title><link>https://gophercoding.com/md5-encode-in-golang/</link><pubDate>Sun, 12 Feb 2023 09:00:00 +0000</pubDate><guid>https://gophercoding.com/md5-encode-in-golang/</guid><description>&lt;p>You can use the &lt;code>crypto/md5&lt;/code> [&lt;a href="https://pkg.go.dev/crypto/md5">docs&lt;/a>] package in Go to perform MD5 encoding on a string. We have an example function below, it will take your string and write it as a hash. Then convert that binary back into a hexadecimal string using &lt;code>Sprintf&lt;/code>.&lt;/p>
&lt;p>&lt;strong>Note:&lt;/strong> There are &lt;a href="https://security.stackexchange.com/questions/19906/is-md5-considered-insecure">more modern approaches&lt;/a> than md5 these days - and it isn&amp;rsquo;t recommended for many things, but definitely not password hashing.&lt;/p>
&lt;p>Here&amp;rsquo;s an example of how to use it:&lt;/p></description></item></channel></rss>