sha512

最后更新于:2022-04-02 02:43:01

[TOC] ## 三种方式 ``` fmt.Printf("%x\n", sha512.Sum512([]byte("123"))) // 3c9909afec25354d551dae21590bb26e38d53f2173b8d3dc3eee4c047e7ab1c1eb8b85103e3be7ba613b31bb5c9c36214dc9f14a42fd7a2fdb84856bca5c44c2 hash := sha512.New() hash.Write([]byte("123")) fmt.Printf("%x\n", hash.Sum(nil)) // 3c9909afec25354d551dae21590bb26e38d53f2173b8d3dc3eee4c047e7ab1c1eb8b85103e3be7ba613b31bb5c9c36214dc9f14a42fd7a2fdb84856bca5c44c2 fmt.Printf("%s\n", hex.EncodeToString(hash.Sum(nil))) // 3c9909afec25354d551dae21590bb26e38d53f2173b8d3dc3eee4c047e7ab1c1eb8b85103e3be7ba613b31bb5c9c36214dc9f14a42fd7a2fdb84856bca5c44c2 ```
';