bytesx: Index | Files

package bytesx

import ""

Package bytesx implements highly optimized byte functions which extends the bytes package in the standard library (Currently x86 64-bit only)


Package Files


func EqualThreshold Uses

func EqualThreshold(a, b []byte, t uint8) bool

EqualThreshold returns true if b does not differ in value more than t from the corresponding byte in a. t may take any value from 0 to 255 where 0 is exact match and 255 will match any string. If t is 1 and a is "MNO" and b is "LNP" than EqualThreshold will return true while it will return false if b is "LNQ" or "KNO". The equality check is only made untill the shortest of a and b.

func IndexNotEqual Uses

func IndexNotEqual(a, b []byte) int

IndexNotEqual returns the index of the first non matching byte between a and b, or -1 if a and b are equal untill the shortest of the two.

Updated 2016-07-18. Refresh now. Tools for package owners.