Просмотр исходного кода

Removing dependency on 'crypto' by using erlang:md5/1 instead of crypto:sha/1

Christian Sunesson 16 лет назад
Родитель
Сommit
251acc61a0
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      src/erlydtl/erlydtl_compiler.erl

+ 2 - 3
src/erlydtl/erlydtl_compiler.erl

@@ -85,7 +85,6 @@ compile(Binary, Module, Options) when is_binary(Binary) ->
     end;
     
 compile(File, Module, Options) ->  
-    crypto:start(),
     Context = init_dtl_context(File, Module, Options),
     case parse(File, Context) of  
         ok ->
@@ -161,7 +160,7 @@ is_up_to_date(CheckSum, Context) ->
                             ({XFile, XCheckSum}, Acc) ->
                                 case catch M:F(XFile) of
                                     {ok, Data} ->
-                                        case binary_to_list(crypto:sha(Data)) of
+                                        case binary_to_list(erlang:md5(Data)) of
                                             XCheckSum ->
                                                 Acc;
                                             _ ->
@@ -187,7 +186,7 @@ parse(File, Context) ->
     {M, F} = Context#dtl_context.reader,
     case catch M:F(File) of
         {ok, Data} ->
-            CheckSum = binary_to_list(crypto:sha(Data)),
+            CheckSum = binary_to_list(erlang:md5(Data)),
             parse(CheckSum, Data, Context);
         _ ->
             {error, "reading " ++ File ++ " failed "}