sha1write: make buffer const-correct