(set 'hextab "0123456789abcdef") (define (int->hexstr num) (set 'hexstr "") (for (i 0 63 4) (push (hextab (& (>> num i) 0xf)) hexstr)) (append "0x" hexstr)) (define (hexstr->int str) (set 'num 0) (set 'str (pop str 2)) (for (i 0 15 1) (| (<< (find (str i) hextab) (* 4 i)) num)))
You need to create an account or log in to post comments to this site.