Added hashing of EWS calendar item IDs

This commit is contained in:
Andreas Schneider 2018-04-01 16:19:20 +02:00
parent 5d62c932d5
commit e3288f9848
1 changed files with 16 additions and 4 deletions

View File

@ -2,6 +2,8 @@ package main
import (
"bytes"
"crypto/md5"
"encoding/hex"
"encoding/xml"
"fmt"
"io"
@ -22,6 +24,16 @@ type CalendarItem struct {
UID string
Start time.Time
End time.Time
RecurrenceId string
Sensitivity string
CalendarItemType string
}
func (ci CalendarItem) Hash() string {
h := md5.New()
h.Write([]byte(ci.UID))
h.Write([]byte(ci.RecurrenceId))
return strings.ToUpper(hex.EncodeToString(h.Sum(nil)))
}
type EWSCalendar struct {