Revision 41f47563bcbc10f7ed751930faba709a1851fdd3 authored by Dilum Aluthge on 21 October 2021, 16:58:24 UTC, committed by Kristoffer on 09 November 2021, 08:44:57 UTC
to make it easier to add more information in the future

(cherry picked from commit 9e3cfc06edde6b99d7716063139db7e810e5277c)
1 parent 3479d89
Raw File
bin2hex.scm
(define (read-u8) (io.read *input-stream* 'uint8))
(define modulo mod)
(define display princ)
(let loop ((b (read-u8))
           (i 0))
  (if (not (eof-object? b))
      (begin
        (if (> i 0)
            (display ", "))
        (display "0x") (display (number->string b 16))
        (if (= 0 (modulo (+ 1 i) 16))
            (newline))
        (loop (read-u8) (+ 1 i)))))
(newline)
back to top