ios

package module
v0.0.0-...-7bb373d Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const PrimeRK = 16777619

Variables

This section is empty.

Functions

func CutOver

func CutOver(n int) int

func HashStrBytes

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

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

func Index

func Index(s, sep []byte) int

Index returns the index of the first instance of sep in s, or -1 if sep is not present in s.

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.

Types

type BytesReplacingReader

type BytesReplacingReader struct {
	// contains filtered or unexported fields
}

BytesReplacingReader allows transparent replacement of a given token during read operation.

func NewBytesReplacingReader

func NewBytesReplacingReader(r io.Reader, search, replace []byte) *BytesReplacingReader

NewBytesReplacingReader creates a new `*BytesReplacingReader`. `search` cannot be nil/empty. `replace` can.

func (*BytesReplacingReader) Read

func (r *BytesReplacingReader) Read(p []byte) (int, error)

Read implements the `io.Reader` interface.

func (*BytesReplacingReader) Reset

func (r *BytesReplacingReader) Reset(r1 io.Reader, search1, replace1 []byte) *BytesReplacingReader

Reset allows reuse of a previous allocated `*BytesReplacingReader` for buf allocation optimization. `search` cannot be nil/empty. `replace` can.

Jump to

Keyboard shortcuts

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