Priority/backend/hash.go
Miki b1745ede2e +backend
+frontend empty
2023-12-05 13:48:13 +01:00

12 lines
166 B
Go

package main
import (
"crypto/sha256"
"fmt"
)
func CalcId(str string, len int) string {
id := sha256.Sum256([]byte(str))
return fmt.Sprintf("%X", id)[0:len]
}