Skip to content

Instantly share code, notes, and snippets.

@lucemia
Created January 7, 2014 03:14
Show Gist options
  • Select an option

  • Save lucemia/8294130 to your computer and use it in GitHub Desktop.

Select an option

Save lucemia/8294130 to your computer and use it in GitHub Desktop.
open bidder how to decode ip
This field is indeed a little nasty, for parsing it check the documentation from the protobuf:
// The first 3 bytes of the IP address in network byte order for IPv4, or the
// first 6 bytes for IPv6. Note that the number and position of the bytes
// included from IPv6 addresses may change later.
This means you must first check if the size is 3 or 6 bytes, then depending on the size you can get the raw bytes and create the partial IP of the correct type. The last octet is not provided because Ad Exchange removes this information for privacy reasons.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment