DecodeBase64 produces the string represented by the base64 encoded input.
()
| 289 | |
| 290 | // DecodeBase64 produces the string represented by the base64 encoded input. |
| 291 | func (p *Pipe) DecodeBase64() *Pipe { |
| 292 | return p.Filter(func(r io.Reader, w io.Writer) error { |
| 293 | decoder := base64.NewDecoder(base64.StdEncoding, r) |
| 294 | _, err := io.Copy(w, decoder) |
| 295 | if err != nil { |
| 296 | return err |
| 297 | } |
| 298 | return nil |
| 299 | }) |
| 300 | } |
| 301 | |
| 302 | // Dirname reads paths from the pipe, one per line, and produces only the |
| 303 | // parent directories of each path. For example, /usr/local/bin/foo would |