issues
search
eklem
/
nfc-json-transfer
P2P - Mobile to mobile NFC transfer of JSON data
MIT License
1
stars
1
forks
source link
Functions to be and structure of objects to send back and forth
#17
Open
eklem
opened
1 year ago
eklem
commented
1 year ago
read function
read RFID-card
write function
write to RFID-card
and call Read function to check that same is read that was supposed to be written
Stringify JSON object
Not sure, thinking really simple, almost not woth a function
Call hashing funtion and create a hash on full stringified JSON object
Parse stringified JSON object
Piece together all hash-verified chunks and verify the end result
Parse it
Recursive function to determin size of RFID-chip
Stringify JSON object to transfer
First time: Try to write all data, halve the size if no success.
2-[n]: Continue with the size determined from first time, but still halve it if no success
Keep control of reminder of stringified JSON object
Keep control of chunk size of stringified JSON object to send (from first time and 2-[n] time if reassessed)
hashing function
string (stringified JSON object)
Transmitter/reciever objects
Transmitter object (sent from transmitter to reciver)
Stringified version of JSON object to be transferred
Control-hash of stringified JSON object
lastPartToSend: true/false
Reciver object (sent from reciever to transmitter)
hashing the recieved chunk of string, and:
sending back hashVerified: true/false,
or
just the hash done by the reciver
if lastPartToSend from transmitter: hashing the full stringified JSON object
read function
write function
Stringify JSON object
Parse stringified JSON object
Recursive function to determin size of RFID-chip
hashing function
Transmitter/reciever objects
Transmitter object (sent from transmitter to reciver)
Reciver object (sent from reciever to transmitter)