bugfix: Use better hash algo

This commit is contained in:
jamesread 2024-02-22 23:31:13 +00:00
parent 2dee246593
commit 0c5a99cc03
1 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,7 @@
package grpcapi
import (
"crypto/md5"
"crypto/sha256"
"fmt"
pb "github.com/OliveTin/OliveTin/gen/grpc"
acl "github.com/OliveTin/OliveTin/internal/acl"
@ -118,7 +118,10 @@ func buildChoices(choices []config.ActionArgumentChoice) []*pb.ActionArgumentCho
}
func createPublicID(action *config.Action, entityPrefix string) string {
return fmt.Sprintf("%x", md5.Sum([]byte(action.ID+"."+entityPrefix)))
h := sha256.New()
h.Write([]byte(action.ID+"."+entityPrefix))
return fmt.Sprintf("%x", h.Sum(nil))
}
func findActionByPublicID(id string) *config.Action {