Created
January 17, 2020 13:20
-
-
Save linasm/d90cdebb834a61db87da162489ea1781 to your computer and use it in GitHub Desktop.
Success bit mask precomputing for Shifting Bit Mask string search algorithm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def process(value: Byte): Boolean = { | |
currentMask = ((currentMask << 1) | 1) & bitMasks(toUnsignedInt(value)) | |
(currentMask & successBitMask) == 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment