code: func (r *RS) Update(oldData []byte, newData []byte, updateRow int, parity [][]byte) (err error) {
  	// check args
  	if len(parity) != r.ParityCnt {
  		err = ErrMismatchParityCnt
  		return
  	}
  	size := len(newData)
  	if size <= 0 {
  		err = ErrIllegalUpdateSize
  		return
  	}
  	if size != len(oldData) {
  		err = ErrIllegalUpdateSize
  		return
  	}
  	for i := range parity {
  		if len(parity[i]) != size {
  			err = ErrIllegalUpdateSize
  			return
  		}
  	}
  	if updateRow >= r.DataCnt {
  		err = ErrIllegalUpdateRow
  		return
  	}
  
  	// step1: buf (old_data xor new_data)
  	buf := make([]byte, size)
  	xor.Encode(buf, [][]byte{oldData, newData})
  	// step2: reEnc parity
  	updateVects := make([][]byte, 1+r.ParityCnt)
  	updateVects[0] = buf
  	updateGenMatrix := make([]byte, r.ParityCnt)
  	// make update_generator_matrix & update_vects
  	for i := 0; i < r.ParityCnt; i++ {
  		col := updateRow
  		off := i*r.DataCnt + col
  		c := r.genMatrix[off]
  		updateGenMatrix[i] = c
  		updateVects[i+1] = parity[i]
  	}
  	updateRS := &RS{DataCnt: 1, ParityCnt: r.ParityCnt, genMatrix: updateGenMatrix, cpu: r.cpu}
  	updateRS.encode(updateVects, true)
  	return nil
  }
docs: // UpdateParity update parity_data when one data_vect changes