Skip to content

Limit decoded barcode to certain characters, e.g. hex #535

Answered by myleftshoe
myleftshoe asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for sharing your approach! I use the onDetected callback to do the simple 12 char hex check first as a pre-validation, if it fails then don't even attempt to fetch data from the db because it definitely won't exist. If it passes the check I look up the db but leave quagga running, i.e. I get subsequent detections while the fetch is in progress but simply ignore them using an isFetching flag until i get the response. If the fetch fails I set isFetching to false again and the process repeats until the fetch succeeds.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@myleftshoe
Comment options

Answer selected by ericblade
Comment options

You must be logged in to vote
1 reply
@myleftshoe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants