NewEncoder returns a new encoder that writes to w.
(w io.Writer)
| 30 | |
| 31 | // NewEncoder returns a new encoder that writes to w. |
| 32 | func NewEncoder(w io.Writer) *Encoder { |
| 33 | h := hash.New(hash.CryptoType) |
| 34 | mw := io.MultiWriter(w, h) |
| 35 | return &Encoder{mw, h, nil} |
| 36 | } |
| 37 | |
| 38 | // Encode writes the Index to the stream of the encoder. |
| 39 | func (e *Encoder) Encode(idx *Index) error { |
searching dependent graphs…