From 8ae5e1a8be5c44b15f45d4707083ae2e8bd2b6c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 8 Feb 2026 16:38:42 +0100 Subject: [PATCH] tpl: Move from md5 to xxhash for some in memory keys --- tpl/templates/templates.go | 2 +- tpl/transform/unmarshal.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tpl/templates/templates.go b/tpl/templates/templates.go index 5f7db243c..77efcdf62 100644 --- a/tpl/templates/templates.go +++ b/tpl/templates/templates.go @@ -131,7 +131,7 @@ func (ns *Namespace) DoDefer(ctx context.Context, id string, optsv any) string { templateName := id var key string if opts.Key != "" { - key = hashing.MD5FromStringHexEncoded(opts.Key) + key = hashing.XxHashFromStringHexEncoded(opts.Key) } else { key = strconv.FormatUint(defferedIDCounter.Add(1), 10) } diff --git a/tpl/transform/unmarshal.go b/tpl/transform/unmarshal.go index d0edda453..2a2a526dd 100644 --- a/tpl/transform/unmarshal.go +++ b/tpl/transform/unmarshal.go @@ -125,7 +125,7 @@ func (ns *Namespace) Unmarshal(args ...any) (any, error) { return nil, nil } - key := hashing.MD5FromStringHexEncoded(dataStr) + key := hashing.XxHashFromStringHexEncoded(dataStr) if decoder != metadecoders.Default { key += decoder.OptionsKey() -- 2.39.5