agarrharr / barcode-binary-is-valid

πŸŽ› Checks binary value of a barcode to see if it's valid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

barcode-binary-is-valid

Build Status

Install

$ npm install --save barcode-binary-is-valid

Usage

const barcodeBinaryIsValid = require('barcode-binary-is-valid');

barcodeBinaryIsValid('10100011010110001001100100011010001101000110101010111001011001101101100100111011001101000100101')
//=> true

barcodeBinaryIsValid('10110011')
//=> {
  success: false,
  message: 'Incorrect length: Should have 95 bits'
  code: 'LENGTH',
}

API

barcodeBinaryIsValid(bars)

Returns barcode in binary

bars

Type: string

A binary representation of the barcode in binary.

License

MIT

About

πŸŽ› Checks binary value of a barcode to see if it's valid

License:MIT License


Languages

Language:JavaScript 100.0%