MCPcopy
hub / github.com/txthinking/brook / SHA256Bytes

Function SHA256Bytes

util.go:88–100  ·  view source on GitHub ↗
(s []byte)

Source from the content-addressed store, hash-verified

86}
87
88func SHA256Bytes(s []byte) ([]byte, error) {
89 var h hash.Hash
90 h = sha256.New()
91 n, err := h.Write(s)
92 if err != nil {
93 return nil, err
94 }
95 if n != len(s) {
96 return nil, errors.New("Write length error")
97 }
98 r := h.Sum(nil)
99 return r, nil
100}

Callers 5

NewQUICClientFunction · 0.85
NewWSClientFunction · 0.85
NewWSServerFunction · 0.85
NewQUICServerFunction · 0.85
NewBrookLinkFunction · 0.85

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected