Skip to content

Instantly share code, notes, and snippets.

View sadikay's full-sized avatar
🎯
Focusing

Sadik Ay sadikay

🎯
Focusing
View GitHub Profile
@sadikay
sadikay / verifyVkn.js
Last active November 8, 2023 13:24 — forked from defiant/verifyVkn.js
Vergi Kimlik Numarası (VKN) doğrulama.
// Examples:
// Valid: "3973535717", "2037637860", "2823097943", "2012460224"
// Not Valid: "3973535711", "123", "9999999999",
function verifyVkn(vkn) {
if (typeof vkn !== 'string') throw new TypeError('vkn should be a string');
if (vkn.length !== 10) throw new TypeError('invalid length');
const digits = vkn.split('');
const control = digits.pop(); // eslint-disable-line