1

I upgraded the elixir version a few days ago, and today I just want to upgrade the erlang version. I heard that the performance of OTP24 has been greatly improved. After the upgrade, after compiling, a lot of warnings & errors were reported. Let's solve them one by one.

1

** (UndefinedFunctionError) function :crypto.block_encrypt/3 is undefined or private, use crypto:crypto_one_time/4 or crypto:crypto_init/3 + crypto:crypto_update/2 + crypto:crypto_final/1 instead

The first is :crypto the api of the 06177981e8be1f module has changed. The reason for the change is said to be the change of the OpenSSL api. http://erlang.org/doc/apps/crypto/new_api.html#the-old-api Fortunately, I searched the Internet and found a solution.

Use :crypto.crypto_one_time function instead, the last parameter is a Boolean value, true means encryption, false means decryption. See the documentation for specific usage.

2

In addition, the :crypto.hmac function is gone. Use :crypto.mac(:hmac, ...) . Refer to the function documentation for details. Just replace it manually.

3

Due to the above reasons, some dependent libraries are no longer available. Fortunately, the libraries commonly used in the elixir community are frequently maintained. Find the latest version on hex.pm and just update it.

Some NIF libraries cannot be compiled and passed under 24, because 24 removes erl_interface. Find -lerl_interface , just delete it directly. If not, try adding -lei . If it doesn't work, just take a look at the documentation.

4

In this way, a pleasant erlang major version upgrade is completed.


Ljzn
399 声望102 粉丝

网络安全;函数式编程;数字货币;人工智能