Re: [racket-users] Re: inflate/deflate

2021-12-11 Thread Stephen De Gabrielle
On Fri, 10 Dec 2021 at 22:29, reilithion wrote: > > > On Friday, January 13, 2017 at 5:32:51 AM UTC-8 Tony Garnock-Jones wrote: > >> On 01/12/2017 11:32 PM, Lehi Toskin wrote: >> > P.S. I didn't see an implementation of ADLER32 anywhere, so I had to >> write my own, which took a little longer

Re: [racket-users] Re: inflate/deflate

2021-12-10 Thread reilithion
On Friday, January 13, 2017 at 5:32:51 AM UTC-8 Tony Garnock-Jones wrote: > On 01/12/2017 11:32 PM, Lehi Toskin wrote: > > P.S. I didn't see an implementation of ADLER32 anywhere, so I had to > write my own, which took a little longer than expected, but oh well. > > Oh, cool. That'd probably

Re: [racket-users] Re: inflate/deflate

2017-01-13 Thread Lehi Toskin
On Friday, January 13, 2017 at 5:32:51 AM UTC-8, Tony Garnock-Jones wrote: > > Oh, cool. That'd probably be a useful thing for Racket's > net/git-checkout module, which has a piece of code in `zlib-inflate` > that reads: > > ... > (inflate i o) > ;; Verify checksum? > (read-bytes-exactly

Re: [racket-users] Re: inflate/deflate

2017-01-13 Thread Tony Garnock-Jones
On 01/12/2017 11:32 PM, Lehi Toskin wrote: > `number->bytes`, is a function I made; its definition is > (define (number->bytes num) > (define hex (number->string num 16)) > ; from file/sha1 > (hex-string->bytes (if (even? (string-length hex)) hex (string-append "0" > hex You might be

Re: [racket-users] Re: inflate/deflate

2017-01-13 Thread Tony Garnock-Jones
On 01/12/2017 11:32 PM, Lehi Toskin wrote: > P.S. I didn't see an implementation of ADLER32 anywhere, so I had to write my > own, which took a little longer than expected, but oh well. Oh, cool. That'd probably be a useful thing for Racket's net/git-checkout module, which has a piece of code in

Re: [racket-users] Re: inflate/deflate

2017-01-12 Thread Lehi Toskin
Thanks to Tonyg's links, I figured out that the part I was missing was the ADLER-32 check of the uncompressed data added to the end of the byte string. That makes the total byte string composition look like this: (bytes #x78 #x9c) compressed-data-from-deflate (number->bytes (adler32

Re: [racket-users] Re: inflate/deflate

2017-01-12 Thread Tony Garnock-Jones
Hi Lehi, On 01/12/2017 06:17 PM, Lehi Toskin wrote: > Now that I think about it, it's probably naive of > me to simple add those two bytes and expect everything to actually be > working as expected [...] I'm assuming the Z_BUF_ERROR is being > reported because it's not as flexible and the

[racket-users] Re: inflate/deflate

2017-01-12 Thread Lehi Toskin
On Thursday, January 12, 2017 at 10:59:13 AM UTC-8, Ethan Estrada wrote: > Then, is this a bug or something that should be an optional argument on the > function like `#:ignore-initial-bytes #t`? I am not deeply familiar with the > DEFLATE file format, but this seems like bug since it doesn't

[racket-users] Re: inflate/deflate

2017-01-11 Thread Lehi Toskin
Interesting... If I prepend `(bytes #x78 #x9c)` to the compressed data created by deflate, zlib-flate will uncompress it. Same thing happens in reverse where I skip the first two bytes of the zlib-flate'd data and process it with inflate. -- You received this message because you are subscribed

[racket-users] Re: inflate/deflate

2017-01-11 Thread Lehi Toskin
If I run `gunzip-through-ports`, it errors out with "gnu-unzip: bad header" -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to