MCPcopy Create free account
hub / github.com/LanceLRQ/deer-executor / SHA256Streams

Function SHA256Streams

common/persistence/utils.go:35–45  ·  view source on GitHub ↗

SHA256Streams 对文件流执行SHA256运算

(streams []io.Reader)

Source from the content-addressed store, hash-verified

33
34// SHA256Streams 对文件流执行SHA256运算
35func SHA256Streams(streams []io.Reader) ([]byte, error) {
36 hash := sha256.New()
37 for _, stream := range streams {
38 if _, err := io.Copy(hash, stream); err != nil {
39 return nil, err
40 }
41 }
42 ret := hash.Sum(nil)
43 //hex.EncodeToString(ret)
44 return ret, nil
45}
46
47// RSA2048SignString 对文本执行RSA2048运算
48func RSA2048SignString(body string, privateKey *rsa.PrivateKey) ([]byte, error) {

Callers 7

PersistentJudgeResultFunction · 0.92
PackProblemsAsZipFunction · 0.92
validateProblemPackageFunction · 0.92
PackProblemsFunction · 0.92
SHA256BytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected