13 lines
215 B
Go
13 lines
215 B
Go
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]
|
|
}
|