Skip to content

Instantly share code, notes, and snippets.

@fxn
Last active December 7, 2022 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fxn/10bfa955556de962209465be3eca0668 to your computer and use it in GitHub Desktop.
Save fxn/10bfa955556de962209465be3eca0668 to your computer and use it in GitHub Desktop.
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