Re: [racket-dev] hex decoding?

2013-09-04 Thread David Vanderson
Sorry it took so long, but I've submitted a pull request to make this function public in file/sha1: https://github.com/plt/racket/pull/426 Let me know if I screwed up, it's my first pull request. Thanks, Dave On 06/11/2013 05:11 PM, Robby Findler wrote: Yes, I think file/sha1 is the right

Re: [racket-dev] hex decoding?

2013-06-11 Thread David Vanderson
Thank you Stephen and Tony for your examples. I found the following private function in db/private/mysql/connection.rkt: (define (hex-string-bytes s) (define (hex-digit-int c) (let ([c (char-integer c)]) (cond [(= (char-integer #\0) c (char-integer #\9)) (- c

Re: [racket-dev] hex decoding?

2013-06-11 Thread David Vanderson
On 06/11/2013 04:33 PM, Matthias Felleisen wrote: db/private/mysql/connection.rkt does not export the function, otherwise you could. I don't understand this. I'd like to make the function available to users somewhere - are you saying that's bad? On Jun 11, 2013, at 4:26 PM, David

Re: [racket-dev] hex decoding?

2013-06-11 Thread Matthias Felleisen
Sorry all I am saying the creator of db/private/mysql/connection.rkt didn't anticipate your needs and kept the function private. If you want to submit a pull request to move this function to db or db/base (including an appropriate provide), please do so. On Jun 11, 2013, at 4:41 PM,

Re: [racket-dev] hex decoding?

2013-06-11 Thread Robby Findler
Yes, I think file/sha1 is the right place. Thanks! Robby On Tue, Jun 11, 2013 at 3:26 PM, David Vanderson david.vander...@gmail.comwrote: Thank you Stephen and Tony for your examples. I found the following private function in db/private/mysql/connection.**rkt: (define (hex-string-bytes

Re: [racket-dev] hex decoding?

2013-06-10 Thread Tony Garnock-Jones
Here's the one I've been using in racl (https://github.com/tonyg/racl, raco pkg install racl). It ignores non-hex characters but is less efficient than Stephen's version. Um, and it expects *bytes* as input, not strings. I'm not sure why, actually. (define (hex-string-bytes . strs) (define

[racket-dev] hex decoding?

2013-06-09 Thread David Vanderson
I'm doing some cryptography exercises that involve a lot of hex encoding/decoding. I see there's a bytes-hex-string function in file/sha1 and openssl/sha1, but I can't find a decode function. Is a hex decode function in the distribution? Thanks, Dave _ Racket