summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util.rkt7
1 files changed, 6 insertions, 1 deletions
diff --git a/util.rkt b/util.rkt
index c1325a6..aa9714d 100644
--- a/util.rkt
+++ b/util.rkt
@@ -45,7 +45,12 @@
[endianness : Endianness]
[size : Exact-Nonnegative-Integer])
: Bytes
- (pad-bytes (integer->bytes x endianness) size #x0 'right))
+ (pad-bytes (integer->bytes x endianness)
+ size
+ #x0
+ (if (eq? endianness 'big-endian)
+ 'right
+ 'left)))
(define: (bytes->integer [b : Bytes]) : Exact-Nonnegative-Integer
(for/fold: ([n : Exact-Nonnegative-Integer 0])