mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-18 02:48:40 +00:00
internal/deephash: use hash.BlockSize instead of a constant
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
parent
135b641332
commit
ce7a87e5e4
@ -23,8 +23,7 @@ import (
|
|||||||
|
|
||||||
func calcHash(v interface{}) string {
|
func calcHash(v interface{}) string {
|
||||||
h := sha256.New()
|
h := sha256.New()
|
||||||
// 64 matches the chunk size in crypto/sha256/sha256.go
|
b := bufio.NewWriterSize(h, h.BlockSize())
|
||||||
b := bufio.NewWriterSize(h, 64)
|
|
||||||
scratch := make([]byte, 0, 64)
|
scratch := make([]byte, 0, 64)
|
||||||
printTo(b, v, scratch)
|
printTo(b, v, scratch)
|
||||||
b.Flush()
|
b.Flush()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user