feat(backend): zip page index with natural sort, zip-slip rejection, content hash

This commit is contained in:
2026-09-05 00:22:13 +08:00
parent ed4ee2458f
commit 589cb210bb
3 changed files with 196 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
package bookfile
import (
"crypto/sha256"
"encoding/hex"
"fmt"
)
func Hash(size, modTS int64) string {
sum := sha256.Sum256([]byte(fmt.Sprintf("%d:%d", size, modTS)))
return hex.EncodeToString(sum[:])[:16]
}