Welcome to the CHICKEN Scheme pasting service

hex-string->bytes added by sethalves on Sat Mar 29 22:27:26 2014

(define (hex-string->bytes hexstr)
  ;; convert a string like "a745ff12" to a bytevector
  (let ((result (make-bytevector (/ (string-length hexstr) 2))))
    (let loop ((hexs (string->list hexstr))
               (i 0))
      (if (< (length hexs) 2)
          result
          (let ((ascii (string->number (string (car hexs) (cadr hexs)) 16)))
            (bytevector-u8-set! result i ascii)
            (loop (cddr hexs)
                  (+ i 1)))))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What type of object does `map' expect as second argument?
Visually impaired? Let me spell it for you (wav file) download WAV