Apply the Luhn algorithm to check identifying numbers

I have a scheduled KNIME flows that processes transactionsdone on mobile devices. I need to be able to validate IMEI numbers to confirm whether they are valid. The check is done with the LUHN algorithm, where every second number is doubled, and then all the separate digits are added together.

There is a further validation step using the formula (10-(s mod10)) mod10, but this can be done in a math node.

Does anyone have KNIME solution to do this?

tC/.

I would use a Python Script node and just copy this code here (python - Implementation of Luhn Formula - Stack Overflow - hoping that this is okay) in to the node and ask K-AI to make it run

:slight_smile:

Since K-AI is available I’m a very lazy programmer

3 Likes

:sweat_smile: KAI is on my christmas card list

1 Like

@TigerCole KI suggested two implementations. One with KNIME Expressions the other one with Python

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.