Published on InterSystems Developer Community (https://community.intersystems.com)

Home > Luhn Mod N in Cache?

Question
Daniel Bertozzi · May 14, 2021

Luhn Mod N in Cache?

Hi all

I'm trying to recreate this method below in Cache/IRIS. 

https://en.wikipedia.org/wiki/Luhn_mod_N_algorithm ISO-7812-1 (LUHN-10)

I've been following the javascript example. It seems simple in theory but i'm struggling with which cache methods to pick.

$LENGTH, $System.SQL.FLOOR() - seem ok

$EXTRACT - I think for .charAt (though may need to correct base)

$FIND - for .indexOf

Any suggestion which would be the best ones for the job?

Thanks

Dan

#ObjectScript #Caché #InterSystems IRIS for Health
Product version: IRIS 2019.1
$ZV: IRIS for Windows (x86-64) 2019.1.1 (Build 615_1_20704U) Thu Mar 18 2021 15:49:22 EDT

Source URL:https://community.intersystems.com/post/luhn-mod-n-cache