<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>crays</author_name>
  <author_url>https://blog.hatena.ne.jp/crays/</author_url>
  <blog_title>crays diary</blog_title>
  <blog_url>https://crays.hatenablog.com/</blog_url>
  <categories>
    <anon>仕事</anon>
    <anon>CakePHP</anon>
    <anon>覚書</anon>
    <anon>PHP</anon>
  </categories>
  <description>お仕事で使っているCakePHPに面白いチェックがあった。 クレジットカード番号は、乱数の羅列なのではなく、ルーン・アルゴリズム（Luhn algorithm - Wikipedia）という方法によって算出された数値らしい。これをチェックに使う事ができるので組み込んでみた。 このルーン・アルゴリズムは末尾から数値を一桁飛ばしで２倍にし、全ての桁を足していくと10で割り切れるかというもの。 ちょっと難しいので、図で説明。 例えば、「49927398716」というカード番号だった場合、末尾から一桁飛ばしで二倍にする。 4 9 9 2 7 3 9 8 7 1 6 ↓*2 ↓ *2 ↓ *2 ↓ *2…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcrays.hatenablog.com%2Fentry%2F20081118%2F1226986412&quot; title=&quot;クレジットカード番号のチェックに有効なアルゴリズム - crays diary&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-11-18 14:33:32</published>
  <title>クレジットカード番号のチェックに有効なアルゴリズム</title>
  <type>rich</type>
  <url>https://crays.hatenablog.com/entry/20081118/1226986412</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
