@kszongic/luhn-cli
v1.0.0
Published
Validate and generate Luhn-checksum numbers (credit cards, IMEIs, etc.) from the command line
Downloads
17
Maintainers
Readme
@kszongic/luhn-cli
Validate and generate Luhn-checksum numbers (credit cards, IMEIs, national IDs) from the command line. Zero dependencies.
Install
npm install -g @kszongic/luhn-cliUsage
# Validate a number
luhn validate 4539578763621486
# ✓ 4539578763621486 is valid
# Append check digit to a partial number
luhn generate 453957876362148
# 4539578763621486
# Generate a random valid number
luhn random 16
# 7284930156742839
# Shorthand — just pass a number
luhn 4539578763621486Commands
| Command | Description |
|---------|-------------|
| validate <number> | Check if number passes Luhn algorithm |
| generate <partial> | Append the correct check digit |
| random [length] | Generate a random valid number (default: 16) |
License
MIT © 2026 kszongic
