Last active
December 7, 2022 09:37
-
-
Save fxn/10bfa955556de962209465be3eca0668 to your computer and use it in GitHub Desktop.
This file contains 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
import std/[os,setutils] | |
const | |
markerLen = 4 | |
let datastream = readFile(paramStr(1)) | |
for i in 0 .. (high(datastream) - markerLen): | |
let chunk = datastream[i ..< i + markerLen] | |
if chunk.toSet.card == markerLen: | |
echo i + markerLen | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment