in reply to Re^3: Algorithm inspiration required. (Further thoughts on rolling checksums)
in thread Algorithm inspiration required.

But where is the ultimate limit to this idea?
I didn't find an answer at first, but for me you would want the anchor to be at most the repeating pattern (because a longer anchor will have the same ratio in the data). So you could keep as an anchor either the longest non repeating sequence so far, or as big a sequence as memory will allow.

Actually if your anchor isn't too uniform, rather than compute checksums at each successive position you could then use Boyer Moore to "jump" to the next occurence of the pattern.

If the candidate pattern is too small, let's say N values, just read N values at a time in a loop until you find something that's different from your candidate. That something is probably a good choice of anchor (or as you said /($pattern)*($something)/).

  • Comment on Re^4: Algorithm inspiration required. (Further thoughts on rolling checksums)

Replies are listed 'Best First'.
Re^5: Algorithm inspiration required. (Further thoughts on rolling checksums)
by BrowserUk (Patriarch) on Jun 18, 2018 at 21:19 UTC
    loop until you find something that's different from your candidate. That something is probably a good choice of anchor

    I think this notion is the key to a solution.

    I haven't wrapped my brain around it yet, but I have some ideas. Many thanks for your input. I come back when I have something workable.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit