擅长:python、mysql、java
<p>有一个<a href="https://golang.org/pkg/crypto/sha1/#New" rel="nofollow noreferrer">example</a>如何正确使用它。您应该:</p>
<pre><code>c := sha1.New()
io.WriteString(c, "hello")
myBytes := c.Sum(nil)
fmt.Println(base64.StdEncoding.EncodeToString(myBytes))
</code></pre>
<p><a href="https://play.golang.org/p/sELsWTcrdd" rel="nofollow noreferrer">https://play.golang.org/p/sELsWTcrdd</a></p>