This is the same unsigned varint encoding that protobuf uses.
New to this encoding? Read Google's introduction and/or my didactic Varint128Spec.m.
+ (NSData *)dataWithUnsignedInt:(unsigned int)value;
+ (NSData *)dataWithUInt32:(UInt32)value;
+ (NSData *)dataWithUInt64:(UInt64)value;
This is the same signed varint encoding that protobuf uses.
See Google's introduction and/or SignedVarint128Spec.m.
+ (NSData *)dataWithInt:(int)value;
+ (NSData *)dataWithSInt32:(SInt32)value;
+ (NSData *)dataWithSInt64:(SInt64)value;