I attempting to write an app that allows users to enter information/data and gives back a unique string that represents that data.
I then want someone else (on a different device) to be able to enter that unique string and get back the inputted data from the first user
A vastly simplified example is that I have this information from the user:
Full Name: First Last
Date of Birth: 01/01/01
Favorite Number: 1
and I want to generate a unique string that would look something like this
wa6mpJ3aad3LEAEFHBCMgmep
Then I want someone else to be able to enter the string (wa6mpJ3aad3LEAEFHBCMgmep) and get back the information (name, DOB, number)
My current best idea is using some sort of cipher on the inputted information, putting all the encrypted data together in one string, and then doing the reverse to get the input info back.
However, there are a couple of issues with this such as how to differentiate between different pieces of data (e.g. name and date) once they are all combined together
I also think there should be some easier way of doing this, and I have run across enough pieces of software that use a similar system, I know there must be some standardized way of doing this.
Just can't find the words to make google happy
CodePudding user response:
To differentiate between different pieces of data you can add any special character to the combined string and then split it using the same character after deciphering.
Full Name: First Last&Date of Birth: 01/01/01&Favorite Number: 1
here you can split the string by '&'.