3 Commits

2 changed files with 12 additions and 4 deletions

View File

@ -281,12 +281,12 @@ type REDEV struct {
SW int // Источник поступаемого сигнала
REPORT int // Порт камеры
REIP string // IP камеры
ID int // Идентификатор камеры
ID string // Идентификатор камеры
RENAME string // Название устройства
USER string // Имя пользователя
PWD string // Пароль
URL string // ???
CMDPORT string // ???
CMDPORT uint // ???
}
// 7.29

View File

@ -6,10 +6,18 @@ import (
"encoding/hex"
)
func GenerateVerifyKey(key string) string {
func generateHMAC(key string, data string) string {
mac := hmac.New(md5.New, []byte(key))
mac.Write([]byte(key))
mac.Write([]byte(data))
return hex.EncodeToString(mac.Sum(nil))
}
func GenerateVerifyKey(key string) string {
return generateHMAC(key, key)
}
func GeneratePasswordHash(password string) string {
return generateHMAC("streaming", password)
}