mirror of
https://github.com/aler9/gortsplib
synced 2025-10-23 15:13:30 +08:00
remove deprecated functions
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
@@ -10,6 +11,12 @@ import (
|
||||
"github.com/bluenviron/gortsplib/v4/pkg/url"
|
||||
)
|
||||
|
||||
func md5Hex(in string) string {
|
||||
h := md5.New()
|
||||
h.Write([]byte(in))
|
||||
return hex.EncodeToString(h.Sum(nil))
|
||||
}
|
||||
|
||||
// GenerateNonce2 generates a nonce that can be used in Validate().
|
||||
func GenerateNonce2() (string, error) {
|
||||
byts := make([]byte, 16)
|
||||
@@ -21,17 +28,6 @@ func GenerateNonce2() (string, error) {
|
||||
return hex.EncodeToString(byts), nil
|
||||
}
|
||||
|
||||
// GenerateNonce generates a nonce that can be used in Validate().
|
||||
//
|
||||
// Deprecated: use GenerateNonce2.
|
||||
func GenerateNonce() string {
|
||||
v, err := GenerateNonce2()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
// GenerateWWWAuthenticate generates a WWW-Authenticate header.
|
||||
func GenerateWWWAuthenticate(methods []headers.AuthMethod, realm string, nonce string) base.HeaderValue {
|
||||
if methods == nil {
|
||||
|
Reference in New Issue
Block a user