bytealg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxBruteForce = 64
	PrimeRK       = 16777619
	MaxLen        = 31
)

Variables

This section is empty.

Functions

func Compare

func Compare(a, b []byte) int

func Count

func Count(b []byte, c byte) int

func CountString

func CountString(s string, c byte) int

func Cutover

func Cutover(n int) int

func Equal

func Equal(a, b []byte) bool

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 Index

func Index(a, b []byte) int

func IndexByte

func IndexByte(b []byte, c byte) int

func IndexByteString

func IndexByteString(s string, c byte) int

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.

func IndexRabinKarpBytes

func IndexRabinKarpBytes(s, sep []byte) int

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

func IndexString(a, b string) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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