diff options
Diffstat (limited to 'utils/license.go')
-rw-r--r-- | utils/license.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/license.go b/utils/license.go index fcc08e6b1..69279fd23 100644 --- a/utils/license.go +++ b/utils/license.go @@ -5,11 +5,13 @@ package utils import ( "crypto" + "crypto/md5" "crypto/rsa" "crypto/sha512" "crypto/x509" "encoding/base64" "encoding/pem" + "fmt" "strconv" "strings" @@ -129,3 +131,13 @@ func getClientLicense(l *model.License) map[string]string { return props } + +func GetClientLicenseEtag() string { + value := "" + + for k, v := range ClientLicense { + value += fmt.Sprintf("%s:%s;", k, v) + } + + return model.Etag(fmt.Sprintf("%x", md5.Sum([]byte(value)))) +} |