openreplay/backend/pkg/hashid/hashid.go
Alex K 974afa454b
feat(backend): insert error tags+ (#768)
* feat(backend): transform legacy messages

* refactor(backend/postgres):remove seqIndex transformation

* feat(backend/db): parse & insert errors_tags

* chore(backend): remove building folder after build

* fix(backend/db):remove message types from filter that do not go through kafka 

* fix(backend/assets):use JSException instead of ErrorEvent

* refactor(backend/db):ErrorEvent is no longer a message

* feat(backend/db):insert error tags in clickhouse

* refactor(backend):remove unused LongTask code
2022-10-19 10:31:13 +02:00

25 lines
727 B
Go

package hashid
import (
"encoding/hex"
"hash/fnv"
"strconv"
"openreplay/backend/pkg/messages"
)
func IssueID(projectID uint32, e *messages.IssueEvent) string {
hash := fnv.New128a()
hash.Write([]byte(e.Type))
hash.Write([]byte(e.ContextString))
//hash.Write([]byte(e.Context)) // More detailed that contextString (what about Data Redundancy?)
return strconv.FormatUint(uint64(projectID), 16) + hex.EncodeToString(hash.Sum(nil))
}
func IOSCrashID(projectID uint32, crash *messages.IOSCrash) string {
hash := fnv.New128a()
hash.Write([]byte(crash.Name))
hash.Write([]byte(crash.Reason))
hash.Write([]byte(crash.Stacktrace))
return strconv.FormatUint(uint64(projectID), 16) + hex.EncodeToString(hash.Sum(nil))
}