diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b6a1d6..bea7cac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: ci: runs-on: ubuntu-latest container: - image: shiguredo/shiguredo-erlang:otp-26.0.2-openssl-3.1.2-ubuntu-22.04-x86_64 + image: shiguredo/erlang:otp-27.0.1-openssl-3.3.1-ubuntu-24.04-x86_64 steps: - uses: actions/checkout@v4 - run: make diff --git a/CHANGES.md b/CHANGES.md index d4ef730..0606bcb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,9 +2,13 @@ ## develop -- [UPDATE] rebar3 3.22.1 に更新する +- [CHANGE] rebar3 の minimum_otp_vsn を 27.0 にする - @voluntas -- [UPDATE] GitHub Actions の docker の OTP を 26.0.2 / OpenSSL 3.1.2 に上げる +- [UPDATE] rebar3 3.23.0 に更新する + - @voluntas +- [UPDATE] GitHub Actions の docker の OTP を 27.0.1 / OpenSSL 3.3.1 に上げる + - @voluntas +- [FIX] import を利用しないようにする - @voluntas ## 2023.1.0 diff --git a/README.md b/README.md index 40408ad..3cbc10c 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,15 @@ Erlang 向けの Base32 ライブラリです。次の種類のバージョン ## ビルド -```shell -$ rebar3 compile +```bash +rebar3 compile ``` ## 利用 例: -``` +```bash $ rebar3 shell 1> base32:decode(clockwork, <<"AXQQEB10D5T20WK5C5P6RY90EXQQ4TVK44">>). <<"Wow, it really works!">> @@ -39,8 +39,8 @@ $ rebar3 shell ## ライセンス -``` -Copyright 2021-2023, Shiguredo Inc. +```text +Copyright 2021-2024, Shiguredo Inc. Copyright 2021, SUZUKI Tetsuya (Original Author) Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/rebar.config b/rebar.config index 20fee96..745f289 100644 --- a/rebar.config +++ b/rebar.config @@ -1,7 +1,8 @@ -{minimum_otp_vsn, "26.0"}. +{minimum_otp_vsn, "27.0"}. {erl_opts, [{i, "src"}, warnings_as_errors, + warn_shadow_vars, warn_export_all, warn_unused_import]}. @@ -12,13 +13,13 @@ deprecated_functions]}. %% https://rebar3.org/docs/configuration/configuration/#dialyzer -{dialyzer, [{warnings, [extra_return, +{dialyzer, [{warnings, [error_handling, + extra_return, missing_return, - no_unknown - %% overspecs %% underspecs, + unmatched_returns + %% overspecs %% specdiffs - %% error_handling ]}, incremental, {plt_apps, top_level_deps}, diff --git a/rebar3 b/rebar3 index 8cab495..aaeb4cf 100755 Binary files a/rebar3 and b/rebar3 differ diff --git a/src/base32_clockwork.erl b/src/base32_clockwork.erl index a48c1e1..99fb4c9 100644 --- a/src/base32_clockwork.erl +++ b/src/base32_clockwork.erl @@ -2,8 +2,6 @@ -export([encode/1, decode/1]). --import(base32_utils, [rev_bits_list_to_binary/1, bits_list_size/1]). - -spec encode(binary()) -> binary(). encode(Data) -> @@ -58,7 +56,7 @@ symbol(30) -> $Y; symbol(31) -> $Z. --spec decode(binary()) -> {ok, binary()} | {error, atom()}. +-spec decode(binary()) -> {ok, binary()} | {error, invalid_size | invalid_format}. decode(Data) -> decode0(Data, []). @@ -66,7 +64,7 @@ decode(Data) -> decode0(<<>>, []) -> {ok, <<>>}; decode0(<<>>, Accu = [Last | Prev]) -> - Size = bits_list_size(Accu), + Size = base32_utils:bits_list_size(Accu), Last1 = case Size rem 8 of 0 -> Last; @@ -75,7 +73,7 @@ decode0(<<>>, Accu = [Last | Prev]) -> <> = Last, Last2 end, - {ok, rev_bits_list_to_binary([Last1 | Prev])}; + {ok, base32_utils:rev_bits_list_to_binary([Last1 | Prev])}; decode0(<<_:8>>, []) -> {error, invalid_size}; decode0(<<"0", Next/binary>>, Accu) -> diff --git a/src/base32_crockford.erl b/src/base32_crockford.erl index edde797..91a0646 100644 --- a/src/base32_crockford.erl +++ b/src/base32_crockford.erl @@ -2,8 +2,6 @@ -export([encode/1, encode_check/1, decode/1, decode_check/1]). --import(base32_utils, [rev_bits_list_to_binary/1]). - data_to_integer(Data, Padding) -> data_to_integer0(Data, Padding, 0). @@ -121,7 +119,7 @@ decode(Data) when is_binary(Data) -> decode0(Data, []). --spec decode_check(binary()) -> {ok, binary()} | {error, atom()}. +-spec decode_check(binary()) -> {ok, binary()} | {error, invalid}. decode_check(Data) -> Size = (size(Data) - 1) * 8, <> = Data, @@ -134,7 +132,7 @@ decode_check(Data) -> decode0(<<>>, Accu) -> - Decoded0 = rev_bits_list_to_binary(Accu), + Decoded0 = base32_utils:rev_bits_list_to_binary(Accu), DecodedSize = bit_size(Decoded0), case DecodedSize rem 8 of 0 -> diff --git a/src/base32_rfc4648.erl b/src/base32_rfc4648.erl index 8d778fd..cd5fba9 100644 --- a/src/base32_rfc4648.erl +++ b/src/base32_rfc4648.erl @@ -2,8 +2,6 @@ -export([encode/1, decode/1]). --import(base32_utils, [rev_bits_list_to_binary/1]). - -spec encode(binary()) -> binary(). encode(Data) -> @@ -160,13 +158,13 @@ encode1(<<1:1>>, Accu) -> [$Q | Accu]. --spec decode(binary()) -> {ok, binary()} | {error, atom()}. +-spec decode(binary()) -> {ok, binary()} | {error, invalid_format}. decode(Data) -> decode0(Data, []). decode0(<<>>, Accu) -> - {ok, rev_bits_list_to_binary(Accu)}; + {ok, base32_utils:rev_bits_list_to_binary(Accu)}; decode0(<<"A", Next/bitstring>>, Accu) -> decode0(Next, [<<0:5>> | Accu]); decode0(<<"B", Next/bitstring>>, Accu) ->