Skip to content

Commit 042dc1c

Browse files
committed
Apply go modernize
1 parent 87d915d commit 042dc1c

File tree

1 file changed

+3
-3
lines changed
  • sip-over-websocket-to-webrtc/softphone

1 file changed

+3
-3
lines changed

sip-over-websocket-to-webrtc/softphone/utils.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ type SIPInfoResponse struct {
2323
}
2424

2525
func generateResponse(username, password, realm, method, uri, nonce string) string { // nolint
26-
ha1 := md5.Sum([]byte(fmt.Sprintf("%s:%s:%s", username, realm, password))) //nolint
27-
ha2 := md5.Sum([]byte(fmt.Sprintf("%s:%s", method, uri))) //nolint
28-
response := md5.Sum([]byte(fmt.Sprintf("%x:%s:00000001:%s:auth:%x", ha1, nonce, "0e6758e1adfccffbd0ad9ffdde3ef655", ha2))) //nolint
26+
ha1 := md5.Sum(fmt.Appendf(nil, "%s:%s:%s", username, realm, password)) //nolint
27+
ha2 := md5.Sum(fmt.Appendf(nil, "%s:%s", method, uri)) //nolint
28+
response := md5.Sum(fmt.Appendf(nil, "%x:%s:00000001:%s:auth:%x", ha1, nonce, "0e6758e1adfccffbd0ad9ffdde3ef655", ha2)) //nolint
2929

3030
return fmt.Sprintf("%x", response)
3131
}

0 commit comments

Comments
 (0)