wirecardBrasil / moip-encryption-js-jquery

Cliente Javascript Moip, possibilita a criptografia de dados sensíveis de cartão no browser do cliente assim como identificação e validação de números de cartão de crédito.
https://moip.com.br/docs/#moip-js
46 stars 12 forks source link

Add Banrisul #32

Closed lucasqueiroz closed 7 years ago

lucasqueiroz commented 7 years ago

Add Banrisul

This Pull Request adds Banrisul to the validation of bank accounts.

How is Banrisul verification digit calculated?

  1. Multiply the numbers of the bank account by the corresponding weight (Weights are: 3, 2, 4, 7, 6, 5, 4, 3, 2 in this order)
  2. Sum the result
  3. Get the mod of the sum by 11 (<sum> % 11)
  4. Subtract the result of the mod by 11 (11 - <mod>)

    • If the mod of the sum is 0, the verification digit is 0.
    • If the mod of the sum is 1, the verification digit is 6.
    • Else, the verification digit is 11 - <mod>