Skip to content

Commit

Permalink
Fix exposed type (#41)
Browse files Browse the repository at this point in the history
It's clear, from the implementation, a binary()
is also expected
  • Loading branch information
kivra-pauoli authored Jul 24, 2024
1 parent 26cc5f2 commit f5fdd13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/s2_hash.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down

0 comments on commit f5fdd13

Please sign in to comment.