|
@@ -1,9 +1,9 @@
|
|
|
package chat
|
|
package chat
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
- "crypto/sha256"
|
|
|
|
|
"encoding/hex"
|
|
"encoding/hex"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
|
|
+ "hash/fnv"
|
|
|
"sync"
|
|
"sync"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
@@ -22,7 +22,7 @@ func NewMessageCache() *MessageCache {
|
|
|
|
|
|
|
|
// generateKey creates a unique key for a message based on its content and rendering parameters
|
|
// generateKey creates a unique key for a message based on its content and rendering parameters
|
|
|
func (c *MessageCache) GenerateKey(params ...any) string {
|
|
func (c *MessageCache) GenerateKey(params ...any) string {
|
|
|
- h := sha256.New()
|
|
|
|
|
|
|
+ h := fnv.New64a()
|
|
|
for _, param := range params {
|
|
for _, param := range params {
|
|
|
h.Write(fmt.Appendf(nil, ":%v", param))
|
|
h.Write(fmt.Appendf(nil, ":%v", param))
|
|
|
}
|
|
}
|