go2hx

manual

github

Module: stdgo.internal.bytealg

(view library index)

Overview

Index

Constants

import stdgo.internal.bytealg.Bytealg
final _offsetPPC64HasPOWER9:stdgo.GoUIntptr = stdgo.unsafe.Unsafe.offsetof_(stdgo.Go.toInterface(stdgo.internal.cpu.Cpu.ppc64.isPOWER9))

Offsets into internal/cpu records for use in assembly.

final _offsetS390xHasVX:stdgo.GoUIntptr = stdgo.unsafe.Unsafe.offsetof_(stdgo.Go.toInterface(stdgo.internal.cpu.Cpu.s390x.hasVX))

Offsets into internal/cpu records for use in assembly.

final _offsetX86HasAVX2:stdgo.GoUIntptr = stdgo.unsafe.Unsafe.offsetof_(stdgo.Go.toInterface(stdgo.internal.cpu.Cpu.x86.hasAVX2))

Offsets into internal/cpu records for use in assembly.

final _offsetX86HasPOPCNT:stdgo.GoUIntptr = stdgo.unsafe.Unsafe.offsetof_(stdgo.Go.toInterface(stdgo.internal.cpu.Cpu.x86.hasPOPCNT))

Offsets into internal/cpu records for use in assembly.

final _offsetX86HasSSE42:stdgo.GoUIntptr = stdgo.unsafe.Unsafe.offsetof_(stdgo.Go.toInterface(stdgo.internal.cpu.Cpu.x86.hasSSE42))

Offsets into internal/cpu records for use in assembly.

final maxBruteForce:stdgo.GoUInt64 = ((0i64 : stdgo.GoUInt64))
final primeRK:stdgo.GoUInt64 = ((16777619i64 : stdgo.GoUInt64))

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

Variables

import stdgo.internal.bytealg.Bytealg
var maxLen:stdgo.GoInt

MaxLen is the maximum length of the string to be searched for (argument b) in Index. If MaxLen is not 0, make sure MaxLen \>= 4.

Functions

import stdgo.internal.bytealg.Bytealg

function _abigen_runtime_cmpstring

function _abigen_runtime_cmpstring(_a:stdgo.GoString, _b:stdgo.GoString):stdgo.GoInt

go:linkname abigen_runtime_cmpstring runtime.cmpstring

(view code)

function _abigen_runtime_memequal

function _abigen_runtime_memequal(_a:stdgo.unsafe.UnsafePointer, _b:stdgo.unsafe.UnsafePointer, _size:stdgo.GoUIntptr):Bool

go:linkname abigen_runtime_memequal runtime.memequal

(view code)

function _abigen_runtime_memequal_varlen

function _abigen_runtime_memequal_varlen(_a:stdgo.unsafe.UnsafePointer, _b:stdgo.unsafe.UnsafePointer):Bool

go:linkname abigen_runtime_memequal_varlen runtime.memequal_varlen

(view code)

function compare

function compare(_a:stdgo.Slice<stdgo.GoByte>, _b:stdgo.Slice<stdgo.GoByte>):stdgo.GoInt

go:noescape

(view code)

function count

function count(_b:stdgo.Slice<stdgo.GoByte>, _c:stdgo.GoByte):stdgo.GoInt

(view code)

function countString

function countString(_s:stdgo.GoString, _c:stdgo.GoByte):stdgo.GoInt

(view code)

function cutover

function cutover(_n:stdgo.GoInt):stdgo.GoInt

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.

(view code)

function equal

function equal(_a:stdgo.Slice<stdgo.GoByte>, _b:stdgo.Slice<stdgo.GoByte>):Bool

Equal reports whether a and b are the same length and contain the same bytes. A nil argument is equivalent to an empty slice.

Equal is equivalent to bytes.Equal. It is provided here for convenience, because some packages cannot depend on bytes.

(view code)

function hashStr

function hashStr(_sep:stdgo.GoString):{
	_1:stdgo.GoUInt32;
	_0:stdgo.GoUInt32;
}

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

(view code)

function hashStrBytes

function hashStrBytes(_sep:stdgo.Slice<stdgo.GoByte>):{
	_1:stdgo.GoUInt32;
	_0:stdgo.GoUInt32;
}

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

(view code)

function hashStrRev

function hashStrRev(_sep:stdgo.GoString):{
	_1:stdgo.GoUInt32;
	_0:stdgo.GoUInt32;
}

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

(view code)

function hashStrRevBytes

function hashStrRevBytes(_sep:stdgo.Slice<stdgo.GoByte>):{
	_1:stdgo.GoUInt32;
	_0:stdgo.GoUInt32;
}

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

(view code)

function index

function index(_a:stdgo.Slice<stdgo.GoByte>, _b:stdgo.Slice<stdgo.GoByte>):stdgo.GoInt

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.

(view code)

function indexByte

function indexByte(_b:stdgo.Slice<stdgo.GoByte>, _c:stdgo.GoByte):stdgo.GoInt

go:noescape

(view code)

function indexByteString

function indexByteString(_s:stdgo.GoString, _c:stdgo.GoByte):stdgo.GoInt

go:noescape

(view code)

function indexRabinKarp

function indexRabinKarp(_s:stdgo.GoString, _substr:stdgo.GoString):stdgo.GoInt

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

(view code)

function indexRabinKarpBytes

function indexRabinKarpBytes(_s:stdgo.Slice<stdgo.GoByte>, _sep:stdgo.Slice<stdgo.GoByte>):stdgo.GoInt

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

(view code)

function indexString

function indexString(_a:stdgo.GoString, _b:stdgo.GoString):stdgo.GoInt

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.

(view code)

function makeNoZero

function makeNoZero(_n:stdgo.GoInt):stdgo.Slice<stdgo.GoByte>

MakeNoZero makes a slice of length and capacity n without zeroing the bytes. It is the caller's responsibility to ensure uninitialized bytes do not leak to the end user.

(view code)