Created
February 22, 2014 22:48
-
-
Save viperscape/9163554 to your computer and use it in GitHub Desktop.
int32 to 4 bytes, which could be used to send size of a following datagram, like a bytes header
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
(let [i 128900, b (map #(unchecked-byte(bit-shift-right i (* % 8))) (range 0 4))] | |
{i (reduce +(map #(bit-shift-left (bit-and %1 255) (* %2 8)) b (range 0 4)))}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment