Created
January 12, 2014 13:42
-
-
Save flaper87/8384731 to your computer and use it in GitHub Desktop.
Emulating unpack_from('>I', ...) in the worst way possible
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
fn get_int(s: &str) -> u32 { | |
let mut result = 0 as u32; | |
for b in s.as_bytes().iter() { | |
result = (result<<8) | *b as u32; | |
} | |
result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment