mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-07 04:09:15 +02:00
fix:#75 added hash function to dbEventService
This commit is contained in:
@@ -10,8 +10,13 @@ import (
|
||||
func GenerateUUIDs(events []model.Event) []model.Event {
|
||||
for i, event := range events {
|
||||
// generate a hash value from the event name, course and semester
|
||||
hash := uuid.NewSHA1(uuid.NameSpaceOID, []byte(event.Name+event.Course))
|
||||
events[i].UUID = hash.String()
|
||||
hash := GenerateUUID(event)
|
||||
events[i].UUID = hash
|
||||
}
|
||||
return events
|
||||
}
|
||||
|
||||
func GenerateUUID(event model.Event) string {
|
||||
hash := uuid.NewSHA1(uuid.NameSpaceOID, []byte(event.Name+event.Course)).String()
|
||||
return hash
|
||||
}
|
||||
|
Reference in New Issue
Block a user