internal/deephash: use hash.BlockSize instead of a constant

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
Josh Bleecher Snyder 2021-05-20 09:26:47 -07:00 committed by Josh Bleecher Snyder
parent 135b641332
commit ce7a87e5e4

View File

@ -23,8 +23,7 @@
func calcHash(v interface{}) string {
h := sha256.New()
// 64 matches the chunk size in crypto/sha256/sha256.go
b := bufio.NewWriterSize(h, 64)
b := bufio.NewWriterSize(h, h.BlockSize())
scratch := make([]byte, 0, 64)
printTo(b, v, scratch)
b.Flush()