Skip to content

Instantly share code, notes, and snippets.

@dyoo
Last active December 12, 2015 04:58
Show Gist options
  • Select an option

  • Save dyoo/4718091 to your computer and use it in GitHub Desktop.

Select an option

Save dyoo/4718091 to your computer and use it in GitHub Desktop.
Investigating bytes
#lang racket
(require file/gzip
file/gunzip)
(define sample-file
(bytes-append #"(\"5.3.2\" (\"ab7f6f4533252566bc62383ca395f8272851592b\""
#" . \"9364523f1c28f962fb967025aa140670c9b5b9a5\") "
#"#\"/Users/dyoo/work/minipascal/minipascal/lang/../semantics.rkt\""
#" (collects #\"syntax\" #\"parse\" #\"private\" #\"runtime-report.rkt\")"
#" #\"/Users/dyoo/work/minipascal/minipascal/lang/reader.rkt\")\n"))
(define compressed (open-output-bytes))
(let()
(deflate (open-input-bytes sample-file) compressed)
(void))
(define compressed-bytes (get-output-bytes compressed))
(printf "The last bytes produced by deflate alone:\n")
(for/list ([b (take-right (sequence->list (in-bytes compressed-bytes)) 8)])
b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment