摘要: 主要是获取上传文件的内容、大小、名称以及md5内容加密和sha256内容加密,网上查找的资料很少,花费了挺长时间,记录以备后用 调用方式 阅读全文
posted @ 2019-08-07 17:07 _DongGe 阅读(3306) 评论(0) 推荐(0) 编辑
摘要: func hmacSha256(data string, secret string) string { h := hmac.New(sha256.New, []byte(secret)) h.Write([]byte(data)) return hex.EncodeToString(h.Sum(nil)) } 阅读全文
posted @ 2019-08-07 17:03 _DongGe 阅读(10116) 评论(0) 推荐(0) 编辑
摘要: 定义连接超时及传输超时 封装文件上传函数(本实例采用put上传到第三方接口) 阅读全文
posted @ 2019-08-07 17:01 _DongGe 阅读(1447) 评论(1) 推荐(0) 编辑