Documentation ¶
Index ¶
- Constants
- func Compare(a, b []byte) int
- func Count(b []byte, c byte) int
- func CountString(s string, c byte) int
- func Cutover(n int) int
- func Equal(a, b []byte) bool
- 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(a, b []byte) int
- func IndexByte(b []byte, c byte) int
- func IndexByteString(s string, c byte) int
- func IndexRabinKarp(s, substr string) int
- func IndexRabinKarpBytes(s, sep []byte) int
- func IndexString(a, b string) int
Constants ¶
const ( MaxBruteForce = 64 PrimeRK = 16777619 MaxLen = 31 )
Variables ¶
This section is empty.
Functions ¶
func CountString ¶
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 IndexByteString ¶
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 IndexString ¶
Types ¶
This section is empty.