package bytealg

import "internal/bytealg"

Index

Constants

const MaxBruteForce = 0

Variables

var MaxLen int

MaxLen is the maximum length of the string to be searched for (argument b) in Index.

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

Cutover reports the number of failures of IndexByte we should tolerate before switching over to Index. n is the number of bytes processed so far. See the bytes.Index implementation for details.

func Equal

func Equal(a, b []byte) bool

func Index

func Index(a, b []byte) int

Index returns the index of the first instance of b in a, or -1 if b is not present in a. Requires 2 <= len(b) <= MaxLen.

func IndexByte

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

func IndexByteString

func IndexByteString(s string, c byte) int

func IndexString

func IndexString(a, b string) int

IndexString returns the index of the first instance of b in a, or -1 if b is not present in a. Requires 2 <= len(b) <= MaxLen.

Source Files

bytealg.go compare_native.go count_generic.go equal_native.go index_generic.go indexbyte_native.go

Version
v1.12.0-beta.2
Published
Jan 10, 2019
Platform
js/wasm
Imports
2 packages
Last checked
3 minutes ago

Tools for package owners.