Here are some recipes for interpreting stream of bytes as different C types. I will keep adding more to this as I go…
Convert a byte stream (embedded in a string) into 1 byte signed integers:
“\xfc\xfd\xfe\xff”.unpack(”c*”)
=> [-4, -3, -2, -1]
Convert a byte stream (embedded in a string) into 1 byte unsigned integers:
“\xfc\xfd\xfe\xff”.unpack(”C*”)
=> [252, 253, 254, 255]
-
-
Recent Posts
- Did wordpress upgrade destroy all your unicode posts ?
- Google jumps into custom hosted application bandwagon!
- Book updates
- Books: Two Travelogues
- Seminar: Morgan Dene Oliver - CEO OliverMcMillan
- Seminar: Leo Spiegel - Mission Ventures
- Seminar: John Mutch - MV Advisors
- Quick tip - how to extract audio from youtube videos
- Some excel functions
- श्री गणपती आरती
-
Pages
-
Search
Blogroll
Communicate
Archives
-
-
Home