Last active
April 6, 2022 09:46
-
-
Save vishalwayachal/cb23207676e5d0ba520cfe0ad2f5f6b3 to your computer and use it in GitHub Desktop.
Generate Fake VCF file in JAVASCRIPT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loopindex = 100 | |
vcftext = `` | |
function makeid() { | |
var text = ""; | |
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for (var i = 0; i < 5; i++) | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
return text; | |
} | |
function zeroPad(num) { | |
return num.toString().padStart(3, "0"); | |
} | |
for (let step = 0; step < 200; step++) { | |
nameInit = makeid() | |
vcftext +=`BEGIN:VCARD | |
VERSION:3.0 | |
N:;${nameInit}_NAME+${step};;; | |
FN:${nameInit}_NAME+${step} | |
LATESTDATE:202001112035 | |
COUNTRYISO:ID | |
OPPO_RECENT_CALL:NULL | |
TEL;CELL:+914444444${zeroPad(step)} | |
END:VCARD | |
` | |
} | |
console.log(vcftext) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment