54 lines
1.3 KiB
Markdown
54 lines
1.3 KiB
Markdown
|
# 2024/12/04 日报
|
|||
|
|
|||
|
### 做了什么
|
|||
|
|
|||
|
- **rtsp应用层协议**
|
|||
|
- 实时流传输协议
|
|||
|
- 协议请求方式 Describe高校检测设备在线情况
|
|||
|
|
|||
|
- **rtsp 摘要认证**
|
|||
|
|
|||
|
- response 计算方法如下:
|
|||
|
|
|||
|
***response= md5(md5(username:realm:password):nonce:md5(public_method:url) );***
|
|||
|
|
|||
|
- MD5算法:
|
|||
|
|
|||
|
**hash := md5.Sum([]byte(data))** **return hex.EncodeToString(hash[:])**
|
|||
|
|
|||
|
data为传入需要转换的值 后者为将其转换成字符串
|
|||
|
|
|||
|
- **rtsp鉴权处理流程优化**
|
|||
|
|
|||
|
- 去除必须传入用户名和密码的选项优化就够参数以及返回响应
|
|||
|
|
|||
|
- **梳理海康私有协议流程图**
|
|||
|
|
|||
|
### 学到了什么
|
|||
|
|
|||
|
- **strings.Split用法** **字符拆分**
|
|||
|
|
|||
|
```go
|
|||
|
sentence := "hello world how are you"
|
|||
|
words := strings.Split(sentence, " ")
|
|||
|
fmt.Println(words) //结果 ["hello", "world", "how", "are", "you"]
|
|||
|
```
|
|||
|
|
|||
|
- **url.parse()解析** **地址拆分**
|
|||
|
|
|||
|
```go
|
|||
|
urlstr := "https://www.example.com/path?query=value#fragment"
|
|||
|
u , err := url.Parse(urlstr)
|
|||
|
if err!= nil {
|
|||
|
fmt.Println("解析出错:", err)
|
|||
|
return
|
|||
|
}
|
|||
|
fmt.Println("协议:", u.Scheme) //协议:https
|
|||
|
fmt.Println("主机:", u.Host)
|
|||
|
fmt.Println("路径:", u.Path)
|
|||
|
fmt.Println("查询参数:", u.RawQuery)
|
|||
|
fmt.Println("片段:", u.Fragment)
|
|||
|
```
|
|||
|
|
|||
|
|