Skip to content

Instantly share code, notes, and snippets.

@greghendershott
Created December 4, 2012 02:59
Show Gist options
  • Save greghendershott/4200143 to your computer and use it in GitHub Desktop.
Save greghendershott/4200143 to your computer and use it in GitHub Desktop.
#lang racket
(define (bytes->int32s b)
(for/list ([i (in-range 0 (bytes-length b) 2)])
(integer-bytes->integer (subbytes b i (+ i 2)) #t)))
(bytes->int32s #"\206\367\3447\372\245\247\374\341]\35\334\271\352\352\3527vg\270")
;; => '(-2170 14308 -23046 -857 24033 -9187 -5447 -5398 30263 -18329)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment