diff options
| author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-08-16 21:31:47 +0200 |
|---|---|---|
| committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-08-16 21:31:47 +0200 |
| commit | 8353dfe1a17440264a41903006a7d8d9726e83bc (patch) | |
| tree | 9758b600bb7ef4c65d9cdb97129565cc30e07c8a | |
| parent | 11b159a6e5a472d3757ef6af69172659b61a201d (diff) | |
util.rkt: Adapt padding done by integer->bytes/size to requested endianness.
| -rw-r--r-- | util.rkt | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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]) |
