Skip to content

Commit

Permalink
Merge branch 'feat-add-new-bank-validators' of github.com:Xerpa/bran_…
Browse files Browse the repository at this point in the history
…checker into feat-add-new-bank-validators
  • Loading branch information
Rafael Ramos committed Mar 18, 2021
2 parents 4f1bd9d + a4490b9 commit 8c96b5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/digit_calculator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ defmodule BRAN.DigitCalculator do
|> rem(mod_factor)
end

@spec mod_simple([Integer.t()], Integer.t(), [Integer.t()], Function.t()) :: Integer.t()
@spec mod_simple([integer()], integer(), [integer()], function()) :: integer()
def mod_simple(full_account_number, mod_factor, weights, sum_digits \\ fn stream -> stream end) do
full_account_number
|> calc_numbers(weights, sum_digits)
|> rem(mod_factor)
end

@spec calc_numbers([Integer.t()], [Integer.t()], Function.t()) :: Integer.t()
@spec calc_numbers([integer()], [integer()], function()) :: integer()
defp calc_numbers(account_number, weights, sum_digits) do
cycle = Stream.cycle(weights)

Expand Down

0 comments on commit 8c96b5d

Please sign in to comment.