Documentation
¶
Index ¶
- Constants
- func Count(s string, c byte) (n int)
- func CountSlice(b []byte, c byte) (n int)
- func HashStr(sep string) (uint32, uint32)
- func HashStrBytes(sep []byte) (uint32, uint32)
- func HashStrRev(sep string) (uint32, uint32)
- func HashStrRevBytes(sep []byte) (uint32, uint32)
- func Index(s, substr string) int
- func IndexByte(s string, c byte) int
- func IndexRabinKarp(s, substr string) int
- func IndexRabinKarpBytes(s, sep []byte) int
- func IndexSlice(s, sep []byte) int
- func IndexSliceByte(b []byte, c byte) int
Constants ¶
const PrimeRK = 16777619
PrimeRK is the prime base used in Rabin-Karp algorithm.
Variables ¶
This section is empty.
Functions ¶
func CountSlice ¶
func HashStr ¶
HashStr returns the hash and the appropriate multiplicative factor for use in Rabin-Karp algorithm.
func HashStrBytes ¶
HashStrBytes returns the hash and the appropriate multiplicative factor for use in Rabin-Karp algorithm.
func HashStrRev ¶
HashStrRev returns the hash of the reverse of sep and the appropriate multiplicative factor for use in Rabin-Karp algorithm.
func HashStrRevBytes ¶
HashStrRevBytes returns the hash of the reverse of sep and the appropriate multiplicative factor for use in Rabin-Karp algorithm.
func IndexRabinKarp ¶
IndexRabinKarp uses the Rabin-Karp search algorithm to return the index of the first occurrence of substr in s, or -1 if not present.
func IndexRabinKarpBytes ¶
IndexRabinKarpBytes uses the Rabin-Karp search algorithm to return the index of the first occurrence of substr in s, or -1 if not present.
func IndexSlice ¶
func IndexSliceByte ¶
Types ¶
This section is empty.