【发布时间】:2021-03-30 08:24:07
【问题描述】:
我对瑞士工资单的 Luhn 算法有疑问。我在 C、Phyton 或 Java Script 中找到了一个算法,但我不知道如何在 Oracle 上实现这个算法。
http://dnando.github.io/blog/2014/09/23/check-digit-computation-swiss-pay-slips/
http://www.hosang.ch/modulo10.aspx
这个页面展示了算法的样子。
public static int modulo10(string nummer)
{
// 'nummer' darf nur Ziffern zwischen 0 und 9 enthalten!
int[] tabelle = { 0, 9, 4, 6, 8, 2, 7, 1, 3, 5 };
int uebertrag = 0;
foreach (char ziffer in nummer)
uebertrag = tabelle[(uebertrag + ziffer - '0') % 10];
return (10 - uebertrag) % 10;
}
你知道如何在 PLSQL 中实现表吗?
提前感谢您对此算法的帮助。
【问题讨论】:
标签: oracle algorithm plsql luhn