1.0.5 • Published 3 years ago

make-barcode v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

make-barcode

NPM version Known Vulnerabilities npm download

介绍

使用Luhm 校验算法生成一段条码

1、从最后一位数字开始,逆向将奇数位(1、3、5等等)相加。

2、从最后一位数字开始,逆向将偶数位数字,先乘以2(如果乘积为两位数,则将其减去9),再求和。

3、将奇数位总和加上偶数位总和,结果应该可以被10整除。

安装教程

  1. yarn add make-barcode

使用说明

import { getCodeNumber, checkCode } from 'make-barcode';

// 生成条码
const code = getCodeNumber('18');

// 验证条码
const result = checkCode(code)
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago