Created
December 4, 2012 02:59
-
-
Save greghendershott/4200143 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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