Last active
December 12, 2015 04:58
-
-
Save dyoo/4718091 to your computer and use it in GitHub Desktop.
Investigating bytes
This file contains hidden or 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
| #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