Module: stdgo.internal.bytealg
Overview
Index
-
function _abigen_runtime_cmpstring(_a:stdgo.GoString, _b:stdgo.GoString):stdgo.GoInt
-
function compare(_a:stdgo.Slice<stdgo.GoByte>, _b:stdgo.Slice<stdgo.GoByte>):stdgo.GoInt
-
function count(_b:stdgo.Slice<stdgo.GoByte>, _c:stdgo.GoByte):stdgo.GoInt
-
function countString(_s:stdgo.GoString, _c:stdgo.GoByte):stdgo.GoInt
-
function equal(_a:stdgo.Slice<stdgo.GoByte>, _b:stdgo.Slice<stdgo.GoByte>):Bool
-
function hashStr(_sep:stdgo.GoString):{ _1:stdgo.GoUInt32; _0:stdgo.GoUInt32; }
-
function hashStrBytes(_sep:stdgo.Slice<stdgo.GoByte>):{ _1:stdgo.GoUInt32; _0:stdgo.GoUInt32; }
-
function hashStrRev(_sep:stdgo.GoString):{ _1:stdgo.GoUInt32; _0:stdgo.GoUInt32; }
-
function hashStrRevBytes(_sep:stdgo.Slice<stdgo.GoByte>):{ _1:stdgo.GoUInt32; _0:stdgo.GoUInt32; }
-
function index(_a:stdgo.Slice<stdgo.GoByte>, _b:stdgo.Slice<stdgo.GoByte>):stdgo.GoInt
-
function indexByte(_b:stdgo.Slice<stdgo.GoByte>, _c:stdgo.GoByte):stdgo.GoInt
-
function indexByteString(_s:stdgo.GoString, _c:stdgo.GoByte):stdgo.GoInt
-
function indexRabinKarp(_s:stdgo.GoString, _substr:stdgo.GoString):stdgo.GoInt
-
function indexString(_a:stdgo.GoString, _b:stdgo.GoString):stdgo.GoInt
-
function makeNoZero(_n:stdgo.GoInt):stdgo.Slice<stdgo.GoByte>
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
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
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
function compare
function compare(_a:stdgo.Slice<stdgo.GoByte>, _b:stdgo.Slice<stdgo.GoByte>):stdgo.GoInt
go:noescape
function count
function count(_b:stdgo.Slice<stdgo.GoByte>, _c:stdgo.GoByte):stdgo.GoInt
function countString
function countString(_s:stdgo.GoString, _c:stdgo.GoByte):stdgo.GoInt
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.
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.
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.
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.
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.
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.
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.
function indexByte
function indexByte(_b:stdgo.Slice<stdgo.GoByte>, _c:stdgo.GoByte):stdgo.GoInt
go:noescape
function indexByteString
function indexByteString(_s:stdgo.GoString, _c:stdgo.GoByte):stdgo.GoInt
go:noescape
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.
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.
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.
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.