Skip to content

Commit 841e05c

Browse files
committed
pack: add a constant for max hash size
With SHA-256, our maximum hash size is increasing, so we'll need to increase the size of our buffers when reading. However, we'd like to avoid just hard-coding the value 32, so let's create a constant we can update easily should we need to change things in the future.
1 parent 6324dd6 commit 841e05c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pack/index.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ package pack
22

33
import (
44
"bytes"
5+
"crypto/sha256"
56
"fmt"
67
"io"
78
)
89

10+
const maxHashSize = sha256.Size
11+
912
// Index stores information about the location of objects in a corresponding
1013
// packfile.
1114
type Index struct {

0 commit comments

Comments
 (0)