mirror of
https://github.com/xxnuo/MTranServer.git
synced 2026-09-03 06:35:20 +08:00
Update Makefile Update Makefile Update Makefile Update gen_records.go Update build.yml Update build.yml fix: cross build Update build.yml fix: cross build Update build.yml Update build.yml
17 lines
429 B
Go
17 lines
429 B
Go
package bin
|
|
|
|
import "crypto/sha256"
|
|
|
|
//go:generate env GOOS= GOARCH= go run gen_update.go
|
|
//go:generate env GOOS= GOARCH= go run gen_hash.go
|
|
|
|
// GetWorkerInfo returns information about the embedded worker binary
|
|
func GetWorkerInfo() (hash string, size int) {
|
|
return WorkerHash, len(WorkerBinary)
|
|
}
|
|
|
|
// ComputeHash computes the SHA256 hash of the given data
|
|
func ComputeHash(data []byte) [32]byte {
|
|
return sha256.Sum256(data)
|
|
}
|