From f5fdd13de0f02d7b1f9482133a7e4bf8cce14974 Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" <142223309+kivra-pauoli@users.noreply.github.com> Date: Wed, 24 Jul 2024 08:00:01 +0100 Subject: [PATCH] Fix exposed type (#41) It's clear, from the implementation, a binary() is also expected --- src/s2_hash.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s2_hash.erl b/src/s2_hash.erl index 991b986..dc28b5d 100644 --- a/src/s2_hash.erl +++ b/src/s2_hash.erl @@ -43,7 +43,7 @@ luhn(String) when is_list(String) -> {_, Sum} = lists:foldr(fun luhn_fold/2, {odd, 0}, IntList), (Sum*9) rem 10. --spec luhn_validate(string()) -> boolean(). +-spec luhn_validate(binary() | string()) -> boolean(). luhn_validate(String) when is_binary(String) -> luhn_validate(binary_to_list(String)); luhn_validate(String) when is_list(String) ->