anchor.diff:  
   timestamp() ->
       {TM, TS, _} = os:timestamp(),
  -    (TM * 1000000) + TS.+    (TM * 1000000) + TS.
  
positive.code: 
  build_zone(#zone{records = Records} = Zone) ->
      Zone#zone{authority = lists:filter(erldns_records:match_type(?DNS_TYPE_SOA), Records),
          records_by_name = build_named_index(Records)}.
  
  build_zone(Qname, AllowNotifyList, AllowTransferList, AllowUpdateList, AlsoNotifyList,
             NotifySourceIP, Version, Records) ->
      Authority = lists:filter(erldns_records:match_type(?DNS_TYPE_SOA), Records),
      #zone{name = Qname, allow_notify = AllowNotifyList, allow_transfer = AllowTransferList,
            allow_update = AllowUpdateList, also_notify = AlsoNotifyList, notify_source = NotifySourceIP,
            version = Version, record_count = length(Records), authority = Authority, records = Records,
            records_by_name = build_named_index(Records)}.
  
  build_zone(Qname, AllowNotifyList, AllowTransferList, AllowUpdateList, AlsoNotifyList,
             NotifySourceIP, Version, Authority, Records) ->
      #zone{name = Qname, allow_notify = AllowNotifyList, allow_transfer = AllowTransferList,
            allow_update = AllowUpdateList, also_notify = AlsoNotifyList, notify_source = NotifySourceIP,
            version = Version, record_count = length(Records), authority = Authority, records = Records,
            records_by_name = build_named_index(Records)}.
  
  build_named_index(Records) -> build_named_index(Records, dict:new()).
  
negative.code: -spec put_zone({binary(), binary(), [#dns_rr{}]}) -> ok | {error, Reason :: term()}.
  put_zone({Name, Sha, Records, AllowNotifyList, AllowTransferList, AllowUpdateList, AlsoNotifyList,
            NotifySourceIP}) ->
      NormalizedName = normalize_name(Name),
      erldns_storage:insert(zones,
                            {NormalizedName, build_zone(NormalizedName, AllowNotifyList, AllowTransferList,
                                                        AllowUpdateList, AlsoNotifyList,
                                                        NotifySourceIP, Sha, normalize_records(Records))}).
  
  %% @doc Put a zone into the cache and wait for a response.
  -spec put_zone(binary(), #zone{}) -> ok | {error, Reason :: term()}.
  put_zone(Name, #zone{records = Records, authority = [#dns_rr{name = AuthName} = Auth]} = Zone) ->
      NormalizedName = normalize_name(Name),
      erldns_storage:insert(zones, {NormalizedName,
                                    Zone#zone{name = NormalizedName,records = normalize_records(Records),
                                              authority = [Auth#dns_rr{name = normalize_name(AuthName)}]}}).
  
  %% @doc Put a zone into the cache without waiting for a response.
  -spec put_zone_async({binary(), binary(), [#dns_rr{}]}) -> ok | {error, Reason :: term()}.
  put_zone_async({Name, Sha, Records, AllowNotifyList, AllowTransferList, AllowUpdateList, AlsoNotifyList,
                  NotifySourceIP}) ->
      NormalizedName = normalize_name(Name),
      erldns_storage:insert(zones,
                            {NormalizedName, build_zone(NormalizedName, AllowNotifyList,AllowTransferList,
                                                        AllowUpdateList, AlsoNotifyList,
                                                        NotifySourceIP, Sha, normalize_records(Records))}).
  
  %% @doc Put a zone into the cache without waiting for a response.
  -spec put_zone_async(binary(), #zone{}) -> ok | {error, Reason :: term()}.
  put_zone_async(Name, #zone{records = Records, authority = [#dns_rr{name = AuthName} = Auth]} = Zone) ->
      NormalizedName = normalize_name(Name),
      erldns_storage:insert(zones,
                            {NormalizedName, Zone#zone{name = NormalizedName,
                                                       authority = [Auth#dns_rr{name = normalize_name(AuthName)}],
                                                       records = normalize_records(Records)}}).
  
  %% @doc Remove a zone from the cache.
  -spec delete_zone(binary()) -> ok | {error, term()}.
  