Skip to content

Instantly share code, notes, and snippets.

@rtyley
Created August 1, 2011 14:03
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 rtyley/1118177 to your computer and use it in GitHub Desktop.
Save rtyley/1118177 to your computer and use it in GitHub Desktop.
Git loose objects - Experimental format header vs Gzip header checksum
// 0ttt1000
// 0iii1000
def monkey(t: Int, w: Int) = (t<<12) + (8<<8) + (w << 4) + (8)
for (t <- 1 to 4; windowBit <- 0 to 7) {
val header = monkey(t,windowBit)
println(t, windowBit, header, "%04X" format header, header % 31 == 0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment