Jump to content
  • Advertisement
Sign in to follow this  
moeen k

QR code Questions

Recommended Posts

hi.

i just need a simple functionality of qr code on my project but i have some problems about concepts. in my project i just need to scan the qr code and send it to the server and server return the data result based on that qr code.

what now is in my my mind is to:

read the qr code

encode it to some string or binary version

send it to server

server should query the database based of this decoded data and send back the result

therse some doubts about it.

is qr a general standard and a qr code is unique in all apps in the world as its said that it can turn to links. for example a qr code can be read in every scanner apllication? there is a standard database for all qr codes or i just have to implement my own generator reader and encoder and just search the databased based on encoded data?

 

 

 

 

Share this post


Link to post
Share on other sites
Advertisement

Your question is a bit confusing, what do you mean

1 hour ago, moeen k said:

there is a standard database for all qr codes

?

What you want to do is let users enter codes or keys in your app, no difference how you provide those codes to the user. You could use mail or even drums but QR Codes are well established and accepted for simplicity so this is a propper way. Other Apps and games do the same for example when selling promo codes for in-game content.

You usually need a QR decoder/reader in your app because you don't want to transfer the code itself to your server but just the plain data it embedds. On the server side you'll process the code as usually, if you created a coresponding valid code in your database, you'll have to check for correctness or else if you don't want to store those codes, you could use any kind of encryption to generate those codes. For example a combination of elliptic curve cryptography data signing process in combination with some content you generate, for example the ID of a card in your game or an item.

Using ECDSA and diffie hellman key exchange for example along with the bitcoin algorythm to create anonymized key pairs, you are also aware of storing multiple keys on server side while a single key and one temporary auto generated key is enougth to verify the code with your stored secret keys public key

Share this post


Link to post
Share on other sites
2 hours ago, moeen k said:

is qr a general standard and a qr code is unique in all apps in the world as its said that it can turn to links. for example a qr code can be read in every scanner apllication?

It is a standard, defined by an ISO standards document and maintained by a committee like so many other standards. For example, the C++ language is ISO standard 14882, the C language is ISO standard 9899, computer's floating point numbers is ISO standard 754.  QR codes are ISO standard 18004.

Many image processing libraries can encode and decode QR codes, there is no need to send it to a server.  

A QR code holds a lot of data and it is encoded in a particular way. The data includes a format tag that tells you if you're looking at plain text, or a URL, or Kanji language characters, or some other byte stream, up to about 3 kilobtyes of data for big, dense dot patterns.

2 hours ago, moeen k said:

there is a standard database for all qr codes or i just have to implement my own generator reader and encoder and just search the databased based on encoded data?

No standard database.

What you do with those values is up to you, and they depend a great deal on what you store in the pattern. 

If you store a string like "https://gamedev.net" you already know how to interpret that. 

If you store a string like "32MP58HQ-P" that is meaningless to most people without knowing what kind of database to look it up in. A search engine can find it, but a program would need to know where to look to figure out the meaning.

You could store the entire text of this message into a large QR code. Someone could scan it with their phone, and the resulting text would be human readable.  You could encrypt the message and anybody with the QR code could see the cypher-text just like anybody with an encrypted email could see the scrambled contents, only someone with the decryption code could decode it, and they'd need to know what it was they were looking at.

If you want to send the stored value over to a database to look up additional information, that's certainly an option for you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!