anchor.diff:      get_digit(integer_to_list(Input), Digit);
   get_digit(Input, Digit) when is_list(Digit) ->
       get_digit(Input, list_to_integer(Digit));
  -get_digit(Input, Digit) when Digit > length(Input) ->
  +get_digit(Input, Digit) when Digit > erlang:length(Input) ->
       0;
   get_digit(Input, Digit) when Digit > 0 ->
       lists:nth(Digit, lists:reverse(Input)) - $0;
  
positive.code: 
  %% @doc Escapes characters for use in JavaScript strings.
  escapejs(Input) when is_binary(Input) ->
      escapejs(Input, 0);
  escapejs(Input) when is_list(Input) ->
      escapejs(Input, []).
  
  
negative.code: 
  escapejs([], Acc) ->
      lists:reverse(Acc);
  escapejs([C | Rest], Acc) when C < 32; C =:= $"; C =:= $'; C =:= $\\; C =:= $<;
                                 C =:= $>; C =:= $&; C =:= $=; C =:= $-; C =:= $;; 
                                 C =:= 8232; C =:= 8233 -> % just following django here...
      escapejs(Rest, lists:reverse(lists:flatten(io_lib:format("\\u~4.16.0B", [C])), Acc));
  escapejs([C | Rest], Acc) ->
      escapejs(Rest, [C | Acc]).
  
  filesizeformat(Bytes, UnitStr) ->
      lists:flatten(io_lib:format("~.1f ~s", [Bytes, UnitStr])).
  