anchor.diff:  -type index_op() :: add | remove.
   -type index_value() :: integer() | binary().
   -type binary_version() :: v0 | v1.
  +-type encoding() :: erlang | msgpack.
   
   -define(MAX_KEY_SIZE, 65536).
   
  
positive.code: %% @doc Convert binary object to riak object
  -spec from_binary(bucket(),key(),binary()) ->
      riak_object() | {error, 'bad_object_format'}.
  from_binary(_B,_K,<<131, _Rest/binary>>=ObjTerm) ->
      binary_to_term(ObjTerm);
  from_binary(B,K,<<?MAGIC:8/integer, 1:8/integer, Rest/binary>>=_ObjBin) ->
      %% Version 1 of binary riak object
      case Rest of
          <<VclockLen:32/integer, VclockBin:VclockLen/binary, SibCount:32/integer, SibsBin/binary>> ->
              Vclock = binary_to_term(VclockBin),
              Contents = sibs_of_binary(SibCount, SibsBin),
              #r_object{bucket=B,key=K,contents=Contents,vclock=Vclock};
          _Other ->
              {error, bad_object_format}
      end;
  from_binary(_B, _K, Obj = #r_object{}) ->
      Obj.
  
  sibs_of_binary(Count,SibsBin) ->
      sibs_of_binary(Count, SibsBin, []).
  
  sibs_of_binary(0, <<>>, Result) -> lists:reverse(Result);
  sibs_of_binary(0, _NotEmpty, _Result) ->
      {error, corrupt_contents};
  sibs_of_binary(Count, SibsBin, Result) ->
      {Sib, SibsRest} = sib_of_binary(SibsBin),
      sibs_of_binary(Count-1, SibsRest, [Sib | Result]).
  
  sib_of_binary(<<ValLen:32/integer, ValBin:ValLen/binary, MetaLen:32/integer, MetaBin:MetaLen/binary, Rest/binary>>) ->
      <<LMMega:32/integer, LMSecs:32/integer, LMMicro:32/integer, VTagLen:8/integer, VTag:VTagLen/binary, Deleted:1/binary-unit:8, MetaRestBin/binary>> = MetaBin,
  
      MDList0 = deleted_meta(Deleted, []),
  
negative.code: 
  %% @doc Convert riak object to binary form
  -spec to_binary(binary_version(), riak_object()) -> binary().
  -spec to_binary(binary_version(), riak_object(), encoding()) -> binary().
  to_binary(Vers, RObj) ->
      to_binary(Vers, RObj, erlang).
  to_binary(v0, RObj, _) ->
      term_to_binary(RObj);
  to_binary(v1, #r_object{contents=Contents, vclock=VClock}, Enc) ->
      new_v1(VClock, Contents, Enc).
  
  %% @doc convert a binary encoded riak object to a different
  %% encoding version. If the binary is already in the desired
  