github / github/gemoji

Генерация контрольных номеров

Open
#328 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
4.5k
Forks
802
PR merge metrics
No merged PRs in 30d

Description

def luhn_generate(base_digits, length=16):
base = list(map(int, str(base_digits)))
while len(base) < length - 1:
base.append(0) # дополнение нулями
checksum = luhn_checksum(base)
return ''.join(map(str, base)) + str(checksum)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.