diff options
| author | 2026-03-25 14:34:50 +0000 | |
|---|---|---|
| committer | 2026-03-25 14:34:50 +0000 | |
| commit | e4a7aa0742f5070299d37e8421c99d67f0af3f90 (patch) | |
| tree | 36d89781476a92e61280c5ff232a2773e4092c0e /object/store/packed/pack_idx_checksum.go | |
| parent | *: delta -> packfile/delta (diff) | |
| signature | No signature | |
*: object/store -> object/storer v0.1.107
Diffstat (limited to 'object/store/packed/pack_idx_checksum.go')
| -rw-r--r-- | object/store/packed/pack_idx_checksum.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/object/store/packed/pack_idx_checksum.go b/object/store/packed/pack_idx_checksum.go deleted file mode 100644 index 28d4c3db..00000000 --- a/object/store/packed/pack_idx_checksum.go +++ /dev/null @@ -1,34 +0,0 @@ -package packed - -import ( - "bytes" - "fmt" - - objectid "codeberg.org/lindenii/furgit/object/id" -) - -// verifyMappedPackMatchesMappedIdx compares one mapped pack trailer hash with -// the pack hash recorded in one mapped idx trailer. -func verifyMappedPackMatchesMappedIdx(packData, idxData []byte, algo objectid.Algorithm) error { - hashSize := algo.Size() - if hashSize <= 0 { - return objectid.ErrInvalidAlgorithm - } - - if len(packData) < hashSize { - return fmt.Errorf("objectstore/packed: pack too short for trailer hash") - } - - if len(idxData) < hashSize*2 { - return fmt.Errorf("objectstore/packed: idx too short for trailer hashes") - } - - packTrailerHash := packData[len(packData)-hashSize:] - - idxPackHash := idxData[len(idxData)-hashSize*2 : len(idxData)-hashSize] - if !bytes.Equal(packTrailerHash, idxPackHash) { - return fmt.Errorf("objectstore/packed: pack hash does not match idx") - } - - return nil -} |
