# licence **Repository Path**: hsg4ok_admin/licence ## Basic Information - **Project Name**: licence - **Description**: Go版许可证库 - **Primary Language**: Go - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2023-05-24 - **Last Updated**: 2023-05-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # licence ##### Description Go 版序列号 ##### Installation ``` go get gitee.com/eshax/licence ``` ##### Usage - go.mod ``` module licence.test go 1.19 require gitee.com/eshax/licence v0.1.3 ``` - main.go ``` package main import ( "os" "gitee.com/eshax/licence" ) func main() { // // 固定码(项目内自定义) // fixedCode := "test" // // 查询机器码, 根据当前程序所在的硬件环境计算机器码 // MachineCode := licence.GetMachineCode(fixedCode) // // 生成激活码, 根据已知某个服务器的机器码后, 附加限制日期以及参数后, 生成激活码 // date := "2023-12-31" param := licence.Parameters{ Testing: true, UseQRCode: true, UseQRCodeCount: 3, AllowPB: true, AllowBM: true, } machineCode := "BM26H8L9" ActivationCode, err := licence.CreateActivationCode(machineCode, date, param, fixedcode) // // 验证激活码, 当前服务器验证序列号 // activationCode := "5PA-LP213R-B5E" activationStatus, date, parameters, err := CheckActivationCode(activationCode, fixedCode) } ```