anchor.diff:  strip_spaces([$\n|Cs], A) -> strip_spaces(Cs, A);
   strip_spaces([C|Cs], A) -> strip_spaces(Cs, [C | A]).
   
  -strip_ws(<<$\t,T/binary>>) ->
  -    strip_ws(T);
  -strip_ws(<<$\n,T/binary>>) ->
  -    strip_ws(T);
  -strip_ws(<<$\r,T/binary>>) ->
  -    strip_ws(T);
  -strip_ws(<<$\s,T/binary>>) ->
  -    strip_ws(T);
  -strip_ws(T) -> T.
  -
   %% Skipping pad character if not at end of string. Also liberal about
   %% excess padding and skipping of other illegal (non-base64 alphabet)
   %% characters. See section 3.3 of RFC4648
  
positive.code: 	 bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,
  	 bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad,bad}).
  
  decode_binary(Result0, <<C:8,T0/bits>>) ->
      case element(C, ?DECODE_MAP) of
  	bad ->
  	    erlang:error({badarg,C});
  	ws ->
  	    decode_binary(Result0, T0);
  	eq ->
  	    case strip_ws(T0) of
  		<<$=:8,T/binary>> ->
  		    <<>> = strip_ws(T),
  		    Split = byte_size(Result0) - 1,
  		    <<Result:Split/bytes,_:4>> = Result0,
  		    Result;
  		T ->
  		    <<>> = strip_ws(T),
  		    Split = byte_size(Result0) - 1,
  		    <<Result:Split/bytes,_:2>> = Result0,
  		    Result
  	    end;
  	Bits ->
  	    decode_binary(<<Result0/bits,Bits:6>>, T0)
      end;
  decode_binary(Result, <<>>) ->
      true = is_binary(Result),
      Result.
  
  %% Skipping pad character if not at end of string. Also liberal about
  %% excess padding and skipping of other illegal (non-base64 alphabet)
  
negative.code:       Data :: ascii_binary().
  
  decode(Bin) when is_binary(Bin) ->
      decode_binary(Bin, <<>>);
  decode(List) when is_list(List) ->
      decode_list(List, <<>>).
  
  