next #44

Merged
sneak merged 79 commits from next into main 2026-03-15 18:49:20 +01:00
Showing only changes of commit ebaf2a65ca - Show all commits

View File

@@ -3,6 +3,7 @@ package mfer
import (
"crypto/sha256"
"errors"
"fmt"
"io"
"sync"
"time"
@@ -96,6 +97,11 @@ func (b *Builder) AddFile(
}
}
// Verify actual bytes read matches declared size
if totalRead != size {
return totalRead, fmt.Errorf("size mismatch for %q: declared %d bytes but read %d bytes", path, size, totalRead)
}
// Encode hash as multihash (SHA2-256)
mh, err := multihash.Encode(h.Sum(nil), multihash.SHA2_256)
if err != nil {