Here is a summary of the provided text in one paragraph:
QR codes are two-dimensional barcodes that can store up to 3KB of data and have been used for various purposes such as tracking automobile parts, adding contact information to mobile devices, and facilitating contactless payments. However, they also come with risks, including the potential to send users to malicious URLs, as demonstrated by a security researcher who created a QR code that wiped all data on a Samsung phone in 2012. Fortunately, most modern QR scanner apps offer users a preview of the URL and allow them to click through before scanning. Generating QR codes can be complicated, but libraries such as node-qrcode make it easier for developers to create QR codes in their applications. Additionally, QR codes can be used for two-factor authentication, allowing users to generate time-based one-time passwords that can be decoded using a secret key and a timestamp, making them an attractive option for adding extra layers of security to applications.