github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/internal/buildid/rewrite.go (about) 1 // Copyright 2017 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package buildid 6 7 import ( 8 "github.com/shogo82148/std/io" 9 ) 10 11 // FindAndHash reads all of r and returns the offsets of occurrences of id. 12 // While reading, findAndHash also computes and returns 13 // a hash of the content of r, but with occurrences of id replaced by zeros. 14 // FindAndHash reads bufSize bytes from r at a time. 15 // If bufSize == 0, FindAndHash uses a reasonable default. 16 func FindAndHash(r io.Reader, id string, bufSize int) (matches []int64, hash [32]byte, err error) 17 18 func Rewrite(w io.WriterAt, pos []int64, id string) error