document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. func (d *digest) Write(p []byte) (nn int, err error) {
  2.         nn = len(p)
  3.         d.len += uint64(nn)
  4.         if d.nx > 0 {
  5.                 n := len(p)
  6.                 if n > chunk-d.nx {
  7.                         n = chunk - d.nx
  8.                 }
  9.                 for i := 0; i < n; i++ {
  10.                         d.x[d.nx+i] = p[i]
  11.                 }
  12.                 d.nx += n
  13.                 if d.nx == chunk {
  14.                         block(d, d.x[0:chunk])
  15.                         d.nx = 0
  16.                 }
  17.                 p = p[n:]
  18.         }
  19.         if len(p) >= chunk {
  20.                 n := len(p) &^ (chunk - 1)
  21.                 block(d, p[:n])
  22.                 p = p[n:]
  23.         }
  24.         if len(p) > 0 {
  25.                 d.nx = copy(d.x[:], p)
  26.         }
  27.         return
  28. }
');