L

Luhn’s Algorithm

Luhn's Algorithm is a checksum formula used to validate identification numbers, particularly credit card numbers.

Luhn’s アルゴリズム, also known as the ルーンの公式 or モジュラス10アルゴリズム, is a simple checksum formula that is widely used to validate identification numbers, especially credit card numbers. IBMによって開発された scientist ハンス Peter Luhn in 1954, this algorithm helps to prevent accidental errors in data entry and is employed by various industries to ensure the integrity of numeric identifiers.

このアルゴリズムは、次のステップを実行することで動作します:

  1. 一番右の数字から始めて、2番目ごとに数字の値を倍にします。この倍にした結果が9を超える場合は、その結果から9を引きます。
  2. 変更された数字と変更されていない数字のすべてを合計します。
  3. If the total modulo 10 is equal to 0, then the number is valid according to Luhn’s Algorithm.

例えば、番号を考えてみてください 4539 1488 0343 6467:

  • 右から2番目ごとに数字を倍にします:4、 10, 3, 18, 8, 0, 3, 12, 6, 12, 7.
  • 9を超えるものを調整します:4、1、3、9、8、0、3、3、6、3、7。
  • 合計:4 + 1 + 3 + 9 + 8 + 0 + 3 + 3 + 6 + 3 + 7 = 43。
  • 43のモジュロ10が0かどうかを確認します:そうではないので、その番号は無効です。

Luhn’s Algorithm is particularly useful because it can be easily implemented and is effective in detecting simple errors, such as mistyped digits or transposed numbers. However, it’s important to note that while Luhn’s Algorithm can indicate that a number might be valid, it does not guarantee that the number is legitimate or has not been compromised.

コントロール + /