Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ibantools

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ibantools - npm Package Compare versions

Comparing version 4.2.0 to 4.2.1

36

build/ibantools.js

@@ -11,3 +11,3 @@ /*!

* @module ibantools
* @version 4.2.0
* @version 4.2.1
* @license MPL-2.0

@@ -619,30 +619,20 @@ * @preferred

var checkFinlandBBAN = function (bban) {
var weightsMethod1 = [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2];
var weightsMethod2 = [0, 0, 0, 0, 0, 0, 0, 1, 3, 7, 1, 3, 7];
var weights = [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2];
var controlDigit = parseInt(bban.charAt(13), 10);
var toCheck = bban.substring(0, 13);
var sum = 0;
if (toCheck.startsWith('88')) {
for (var index = 0; index < toCheck.length; index++) {
sum += parseInt(toCheck.charAt(index), 10) * weightsMethod2[index];
for (var index = 0; index < toCheck.length; index++) {
if (weights[index] === 1) {
sum += parseInt(toCheck.charAt(index), 10) * weights[index];
}
var remainder = sum % 10;
return controlDigit === (remainder === 0 ? 0 : 10 - remainder);
}
else {
for (var index = 0; index < toCheck.length; index++) {
if (weightsMethod1[index] === 1) {
sum += parseInt(toCheck.charAt(index), 10) * weightsMethod1[index];
}
else {
var value = parseInt(toCheck.charAt(index), 10) * weightsMethod1[index];
sum += Math.floor(value / 10) + (value % 10);
}
else {
var value = parseInt(toCheck.charAt(index), 10) * weights[index];
sum += Math.floor(value / 10) + (value % 10);
}
var extraSum = sum + controlDigit;
var multiDigit = Math.floor(extraSum / 10);
var result = multiDigit * 10;
var remainder = result - sum;
return remainder === controlDigit;
}
var extraSum = sum + controlDigit;
var multiDigit = Math.floor(extraSum / 10);
var result = multiDigit * 10;
var remainder = result - sum;
return remainder === controlDigit;
};

@@ -649,0 +639,0 @@ /**

@@ -11,3 +11,3 @@ /*!

* @module ibantools
* @version 4.2.0
* @version 4.2.1
* @license MPL-2.0

@@ -605,30 +605,20 @@ * @preferred

var checkFinlandBBAN = function (bban) {
var weightsMethod1 = [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2];
var weightsMethod2 = [0, 0, 0, 0, 0, 0, 0, 1, 3, 7, 1, 3, 7];
var weights = [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2];
var controlDigit = parseInt(bban.charAt(13), 10);
var toCheck = bban.substring(0, 13);
var sum = 0;
if (toCheck.startsWith('88')) {
for (var index = 0; index < toCheck.length; index++) {
sum += parseInt(toCheck.charAt(index), 10) * weightsMethod2[index];
for (var index = 0; index < toCheck.length; index++) {
if (weights[index] === 1) {
sum += parseInt(toCheck.charAt(index), 10) * weights[index];
}
var remainder = sum % 10;
return controlDigit === (remainder === 0 ? 0 : 10 - remainder);
}
else {
for (var index = 0; index < toCheck.length; index++) {
if (weightsMethod1[index] === 1) {
sum += parseInt(toCheck.charAt(index), 10) * weightsMethod1[index];
}
else {
var value = parseInt(toCheck.charAt(index), 10) * weightsMethod1[index];
sum += Math.floor(value / 10) + (value % 10);
}
else {
var value = parseInt(toCheck.charAt(index), 10) * weights[index];
sum += Math.floor(value / 10) + (value % 10);
}
var extraSum = sum + controlDigit;
var multiDigit = Math.floor(extraSum / 10);
var result = multiDigit * 10;
var remainder = result - sum;
return remainder === controlDigit;
}
var extraSum = sum + controlDigit;
var multiDigit = Math.floor(extraSum / 10);
var result = multiDigit * 10;
var remainder = result - sum;
return remainder === controlDigit;
};

@@ -635,0 +625,0 @@ /**

{
"name": "ibantools",
"version": "4.2.0",
"version": "4.2.1",
"description": "Validation, extraction and creation of IBAN, BBAN, BIC/SWIFT numbers plus some other helpful stuff like ISO 3136-1 alpha 2 country list",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc