calcHash calculates md5 hash of all lines in the buffer
(out *[md5.Size]byte)
| 162 | |
| 163 | // calcHash calculates md5 hash of all lines in the buffer |
| 164 | func (b *SharedBuffer) calcHash(out *[md5.Size]byte) { |
| 165 | h := md5.New() |
| 166 | |
| 167 | if len(b.lines) > 0 { |
| 168 | h.Write(b.lines[0].data) |
| 169 | |
| 170 | for _, l := range b.lines[1:] { |
| 171 | if b.Endings == FFDos { |
| 172 | h.Write([]byte{'\r', '\n'}) |
| 173 | } else { |
| 174 | h.Write([]byte{'\n'}) |
| 175 | } |
| 176 | h.Write(l.data) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | h.Sum((*out)[:0]) |
| 181 | } |
| 182 | |
| 183 | // MarkModified marks the buffer as modified for this frame |
| 184 | // and performs rehighlighting if syntax highlighting is enabled |
no test coverage detected