Files
pages/internal/compiler/diagram.go
T

25 lines
289 B
Go

package compiler
import (
"crypto/sha256"
"encoding/hex"
)
func DiagramHash(
diagramType string,
source string,
format string,
) string {
sum :=
sha256.Sum256(
[]byte(
diagramType + "\x00" + format + "\x00" + source,
),
)
return hex.EncodeToString(
sum[:],
)
}