MCPcopy
hub / github.com/tinylib/msgp / generateFilePrefix

Function generateFilePrefix

printer/print.go:146–150  ·  view source on GitHub ↗

generateFilePrefix creates a deterministic, unique prefix for constants based on the file name

(filename string)

Source from the content-addressed store, hash-verified

144
145// generateFilePrefix creates a deterministic, unique prefix for constants based on the file name
146func generateFilePrefix(filename string) string {
147 base := filepath.Base(filename)
148 hash := crc32.ChecksumIEEE([]byte(base))
149 return fmt.Sprintf("z%08x", hash)
150}
151
152func writeLimitConstants(b *bytes.Buffer, file string, f *parse.FileSet) {
153 if f.ArrayLimit != math.MaxUint32 || f.MapLimit != math.MaxUint32 {

Callers 1

writeLimitConstantsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…