const offsetX86HasSSE42 … const offsetX86HasAVX2 … const offsetX86HasPOPCNT … const offsetS390xHasVX … const offsetPPC64HasPOWER9 … var MaxLen … const PrimeRK … // HashStr returns the hash and the appropriate multiplicative // factor for use in Rabin-Karp algorithm. func HashStr[T string | []byte](sep T) (uint32, uint32) { … } // HashStrRev returns the hash of the reverse of sep and the // appropriate multiplicative factor for use in Rabin-Karp algorithm. func HashStrRev[T string | []byte](sep T) (uint32, uint32) { … } // IndexRabinKarp uses the Rabin-Karp search algorithm to return the index of the // first occurrence of sep in s, or -1 if not present. func IndexRabinKarp[T string | []byte](s, sep T) int { … } // LastIndexRabinKarp uses the Rabin-Karp search algorithm to return the last index of the // occurrence of sep in s, or -1 if not present. func LastIndexRabinKarp[T string | []byte](s, sep T) int { … } // MakeNoZero makes a slice of length n and capacity of at least n Bytes // without zeroing the bytes (including the bytes between len and cap). // It is the caller's responsibility to ensure uninitialized bytes // do not leak to the end user. func MakeNoZero(n int) []byte