Skip to content

Instantly share code, notes, and snippets.

View quentinlamamy's full-sized avatar

Quentin Lamamy quentinlamamy

View GitHub Profile
@quentinlamamy
quentinlamamy / emvCardStripeParser.js
Last active November 30, 2023 02:14
A emv smartcard parser
/**
* Parse the first track of an emv smartcard
* @param {String} data - The first track of the card
*/
async function parseStripe(data) {
let split = data.split("^");
let cardNumber = split[0].substring(2);
let name = split[1];
@quentinlamamy
quentinlamamy / progress.js
Last active July 27, 2023 21:23
[NodeJs] Progress Bar (Use of ANSI escape sequence to refresh)
/**
* Display a progress bar in the console
* @description The progress bar self update without clearing the console (using ANSI escape codes)
* @author Quentin Lamamy <contact@quentin-lamamy.fr>
* @param {Number} current - Current value
* @param {Number} total - Total value
* @param {String} title - Title of the progress bar
* @param {String} message - Message to display
* @returns {void}
*/