Files
software-station/software-verifier/verifier.go
Sudo-Ivan c58384285a Add SHA256 computation and verification functionality
- Implemented computeSHA256 function to generate hex-encoded SHA256 hashes.
- Added verifySHA256 function to validate input data against expected hash in a WebAssembly context.
- Created main_test.go to include unit tests for computeSHA256 with various input cases.
2025-12-27 15:32:42 -06:00

14 lines
240 B
Go

package main
import (
"crypto/sha256"
"encoding/hex"
)
// computeSHA256 returns the hex-encoded SHA256 hash of the input data.
func computeSHA256(data []byte) string {
hash := sha256.Sum256(data)
return hex.EncodeToString(hash[:])
}