anchor.diff:  decode_nsec_types(Num, <<0:1, Rest/bitstring>>, Types) ->
       decode_nsec_types(Num + 1, Rest, Types);
   decode_nsec_types(Num, <<1:1, Rest/bitstring>>, Types) ->
  -    decode_nsec_types(Num + 1, Rest, [Num|Types]).
  +    NewType = term_or_arg(fun type_to_atom/1, Num),
  +    decode_nsec_types(Num + 1, Rest, [NewType|Types]).
   
   encode_nsec_types([]) -> <<>>;
  -encode_nsec_types([FirstType|_]=UnsortedTypes) when is_list(UnsortedTypes) andalso is_integer(FirstType) ->
  -    Types = lists:sort(sets:to_list(sets:from_list(UnsortedTypes))),
  +encode_nsec_types([_|_]=UnsortedTypes) ->
  +    [FirstType|_] = Types = unique_list([int_or_badarg(fun type_to_int/1, Type)
  +				     || Type <- UnsortedTypes ]),
       FirstWindowNum = FirstType div 256,
       FirstLastType = FirstWindowNum * 256,
       encode_nsec_types(<<>>, <<>>, FirstWindowNum, FirstLastType, Types).
  
positive.code: 			       SaltLen:8/unsigned, Salt:SaltLen/binary-unit:8,
  			       HashLen:8/unsigned, Hash:HashLen/binary-unit:8,
  			       TypeBMP/binary>>, _MsgBin) ->
      #dns_rrdata_nsec3{hash_alg = HashAlg, opt_out = OptOut,
  		      iterations = Iterations, salt = Salt,
  		      hash = Hash, types = decode_nsec_types(TypeBMP)};
  decode_rrdata(_Class, nsec3param, <<Alg:8, Flags:8, Iterations:16, SaltLen:8,
  
negative.code:     const_compare(A, B, Result bor (C1 bxor C2)).
  
  round_pow(N, E) -> round(math:pow(N, E)).
  
  unique_list(List) when is_list(List) ->
      lists:sort(sets:to_list(sets:from_list(List))).
  