rabinkarp

package
v1.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const PrimeRK = 16777619

PrimeRK is the prime base used in Rabin-Karp algorithm.

Variables

This section is empty.

Functions

func HashStr

func HashStr(sep string) (uint32, uint32)

HashStr returns the hash and the appropriate multiplicative factor for use in Rabin-Karp algorithm.

func HashStrBytes

func HashStrBytes(sep []byte) (uint32, uint32)

HashStrBytes returns the hash and the appropriate multiplicative factor for use in Rabin-Karp algorithm.

func HashStrRev

func HashStrRev(sep string) (uint32, uint32)

HashStrRev returns the hash of the reverse of sep and the appropriate multiplicative factor for use in Rabin-Karp algorithm.

func HashStrRevBytes

func HashStrRevBytes(sep []byte) (uint32, uint32)

HashStrRevBytes returns the hash of the reverse of sep and the appropriate multiplicative factor for use in Rabin-Karp algorithm.

func IndexRabinKarp

func IndexRabinKarp(s, substr string) int

IndexRabinKarp uses the Rabin-Karp search algorithm to return the index of the first occurrence of substr in s, or -1 if not present.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL