anchor.diff:      split_once(Rest, Delim, [Char|Acc]);
   split_once([], _Delim, Acc) ->
       {lists:reverse(Acc), ""}.
  +
  +%%%===================================================================
  +%%% Query string
  +%%%===================================================================
   
   parse_query_string(QS) when is_list(QS) ->
       [qs_nameval(Part) || Part <- split_qs(QS)];
  
positive.code: month_name(11) -> "Nov";
  month_name(12) -> "Dec".
  
  ensure_parsed_request_path(Env) ->
      handle_parsed_request_path(
        lists:keyfind(parsed_request_path, 1, Env), Env).
  
  handle_parsed_request_path(false, Env) ->
      {_, RequestPath} = lists:keyfind(request_path, 1, Env),
      Parsed = parse_request_path(RequestPath),
      {Parsed, [{parsed_request_path, Parsed}|Env]};
  handle_parsed_request_path({_, Parsed}, Env) ->
      {Parsed, Env}.
  
  parse_request_path(Path) ->
  
negative.code: unescape_qs_val([], Acc) ->
      lists:reverse(Acc).
  
  %%%===================================================================
  %%% Cookies
  %%%===================================================================
  
  ensure_parsed_cookie(Env) ->
      handle_parsed_cookie(env_val(parsed_cookie, Env), Env).
  
  handle_parsed_cookie(undefined, Env) ->
      Parsed = parse_cookie(env_header("Cookie", Env, "")),
      {Parsed, [{parsed_cookie, Parsed}|Env]};
  handle_parsed_cookie(Parsed, Env) ->
      {Parsed, Env}.
  
  parse_cookie(C) when is_list(C) ->
      [cookie_nameval(Part) || Part <- split_cookie(C)];
  parse_cookie(C) when is_binary(C) ->
      parse_cookie(binary_to_list(C)).
  
  split_cookie(C) ->
      split_all(C, $;, "", []).
  
  cookie_nameval(Str) ->
      {Name, Value} = split_once(Str, $=, ""),
      {strip_spaces(Name), strip_spaces(Value)}.
  
  strip_spaces(S) -> string:strip(S, both, $ ).
  
  cookie_header(Name, Value) ->
      {"Set-Cookie", [Name, "=", Value, "; Version=1"]}.
  
  %%%===================================================================
  %%% Crypto
  %%%===================================================================
  
  -define(NULL_IV_128, <<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>).
  
  decrypt(Data, Key) ->
      PaddedKey = pad(Key, 16),
      unpad(crypto:aes_cbc_128_decrypt(PaddedKey, ?NULL_IV_128, Data)).
  