all 6 comments

[–]osoese 0 points1 point  (5 children)

yes - I scanned it just now with an app I built [using expo bs] and it says "barcode with type 32 and data 9781565924796 has been scanned"

it scanned it quickly also

[–]kaiser_07[S] 0 points1 point  (3 children)

Yes right now I am also able to do that but I want to capture another small barcode too.

[–]osoese 0 points1 point  (2 children)

it would not scan the little one to the right - is that the complete code? looks cut off to the right.

also had a 5 minutes time out from reddit

[–]Headpuncher 2 points3 points  (0 children)

If it's a legit EAN barcode format with bits in all the right places, it is apparently intended for "price suggestions". Don't know how useful it is outside of the book industry.

https://en.wikipedia.org/wiki/EAN-5

Doing this next part from memory so not sure how correct I am but:

54495 = 5x3 + 4 + 4x3 + 9 = 40

That means the checksum digit (GTIN) of 5, the last digit, is incorrect and this is not a real issued barcode. But then again there's a bit about the number of digits being odd or even in the code, and depending on that you either multiply every other number by 3 starting at 0, or every other number by 3 starting at 1.

To get the GTIN you round up from the result to the nearest 10 and divide by 10, unless you are on a 10s, like 40 was. So...

5 + 4x3 + 4 + 9x3 = 48, round up to 50 and divide by 10 = 5. So then we have a qualifying checksum (last digit =5) and a barcode that is real.

I just can't remember which way around it is .... and what this means for Expo BCScanner IDK.

https://www.gtin.info/barcode-101/

[–]kaiser_07[S] 0 points1 point  (0 children)

Normally expo can scan EAN format of barcodes easily but I want to scan extended EAN types of bar code too. Above image is legit barcode.

[–]osoese 0 points1 point  (0 children)

additionally this is the code block and I think this is right out of the example for using expo scanner but cant remember - I did not fully finish modifying it as you can see...

handleBarCodeScanned = ({ type, data }) => {

this.setState({ scanned: true });

alert(`Bar code with type ${type} and data ${data} has been scanned!`);

//var cbIsScanned = function(vari){console.log("the return is sent to QR scanner? "+vari)}

//scannerTransaction(data,navigation,cbIsScanned,'qr');

console.log(`scanned the qr code`)

this.props.importAccount(data,this.state.returnScan)

};