# go-platform-utils **Repository Path**: lxmwuchao/go-platform-utils ## Basic Information - **Project Name**: go-platform-utils - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-03-18 - **Last Updated**: 2025-03-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 适配器工具类 > 主要包含签名和加密相关的工具类。 ## 安装条件 ### 方式一 ```shell git config --global url."git@codeup.aliyun.com:lsxd/zltx/adapter/adapter-cli.git".insteadof "https://codeup.aliyun.com/lsxd/zltx/adapter/adapter-cli.git" ``` ### 方式二 1. go get 报错修改 将以下内容放到 $HOME\.netrc(Linux)或者$HOME\_netrc(Win)文件 ```shell machine codeup.aliyun.com login 用户名 password 密码 ``` 2. 修改 GOPRIVATE ```shell go env -w GOPRIVATE=codeup.aliyun.com ``` ## 安装 ``` go get codeup.aliyun.com/lsxd/zltx/adapter/utils ``` ## 使用 ```go // SetSign 返回请求的签名 func (req *RechargeReq) SetSign() { d := sortx.Sort( sortx.Data(req), ) _, signStr := join.SignStr( join.SortedDict(d), join.SignFilterEmpty(true), join.SignSkipFields("sign"), join.SignSortGenFunc(join.UvSort), join.SignWrap(wrapper.EndWarp, req.c.Sm3Secret.Secret()), ) signed := signx.Sign( signx.WithData(signStr), signx.WithSignFn(hash.Sm3), signx.WithFormatFn(format.HexLower), ) fmt.Println(signed) req.Sign = signed } ```