General library improvements.

This commit is contained in:
2025-05-23 12:28:16 +01:00
parent 4d4eac8a20
commit 067841471f
16 changed files with 1175 additions and 89 deletions
+4 -3
View File
@@ -1,9 +1,9 @@
package gql
import (
"crypto/md5"
"encoding/hex"
"fmt"
"hash/fnv"
"github.com/goccy/go-json"
libpack_logger "github.com/lukaszraczylo/go-simple-graphql/logging"
@@ -17,8 +17,9 @@ func searchForKeysInMapStringInterface(msi map[string]interface{}, key string) i
}
func calculateHash(query *Query) string {
hash := md5.Sum(query.JsonQuery)
return hex.EncodeToString(hash[:])
hash := fnv.New64a()
hash.Write(query.JsonQuery)
return hex.EncodeToString(hash.Sum(nil))
}
func (b *BaseClient) cacheLookup(hash string) []byte {