Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/inventory.picotech.app/public_html/node_modules/jsbarcode/src/barcodes/ITF/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import ITF from './ITF';
// Calculate the checksum digit
const checksum = (data) => {
const res = data
.substr(0, 13)
.split('')
.map(num => parseInt(num, 10))
.reduce((sum, n, idx) => sum + (n * (3 - (idx % 2) * 2)), 0);
return Math.ceil(res / 10) * 10 - res;
};
class ITF14 extends ITF {
constructor(data, options) {
// Add checksum if it does not exist
if (data.search(/^[0-9]{13}$/) !== -1) {
data += checksum(data);
}
super(data, options);
}
valid() {
return (
this.data.search(/^[0-9]{14}$/) !== -1 &&
+this.data[13] === checksum(this.data)
);
}
}
export default ITF14;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0032 ]-- |