MCPcopy Create free account
hub / github.com/MG-RAST/Shock / writeChecksum

Function writeChecksum

shock-server/request/request.go:248–263  ·  view source on GitHub ↗
(f func() hash.Hash, c chan checkSumCom)

Source from the content-addressed store, hash-verified

246}
247
248func writeChecksum(f func() hash.Hash, c chan checkSumCom) {
249 go func() {
250 h := f()
251 for {
252 select {
253 case b := <-c:
254 if b.n == 0 {
255 c <- checkSumCom{checksum: fmt.Sprintf("%x", h.Sum(nil))}
256 return
257 } else {
258 h.Write(b.buf[0:b.n])
259 }
260 }
261 }
262 }()
263}

Callers

nothing calls this directly

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected