ALR/internal/dlcache/utils.go

17 lines
240 B
Go
Raw Permalink Normal View History

2025-01-14 09:59:00 +00:00
package dlcache
import (
"crypto/sha1"
"encoding/hex"
"io"
)
func hashID(id string) (string, error) {
h := sha1.New()
_, err := io.WriteString(h, id)
if err != nil {
return "", err
}
return hex.EncodeToString(h.Sum(nil)), nil
}