tag:blogger.com,1999:blog-5987791209900104222.post5533794485643844722..comments2023-12-27T05:16:09.968+02:00Comments on $cript Fanatic: PowerShell LUHN validationShay Levyhttp://www.blogger.com/profile/14910279001063843963noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5987791209900104222.post-68522965249173019292017-03-20T19:30:33.490+02:002017-03-20T19:30:33.490+02:00Added the following two lines to the top of the Te...Added the following two lines to the top of the Test-LuhnNumber function for ease of input, so you can just directly enter numbers or strings instead of manually splitting:<br /><br /> if($digits -is [string]){$digits = ([string[]][char[]]$digits) }<br /> if($digits -is [int64]){$digits = ([int[]](($digits -split '') -ne '')) }Jessenoreply@blogger.comtag:blogger.com,1999:blog-5987791209900104222.post-77593294387283106602017-02-06T16:56:00.844+02:002017-02-06T16:56:00.844+02:00Great job! I needed thisGreat job! I needed thisAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5987791209900104222.post-14748894612029509742009-03-20T19:28:00.000+02:002009-03-20T19:28:00.000+02:00Great snippet, thanks! Helped me generate 9 digit...Great snippet, thanks! Helped me generate 9 digit National Provider Ids, just had to add 24 to the sum.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5987791209900104222.post-41210019326169107992008-01-03T20:14:00.000+02:002008-01-03T20:14:00.000+02:00Good stuff. Reduce your keystrokeswith the ql func...Good stuff. <BR/>Reduce your keystrokes<BR/>with the <B><I>ql</I></B> function (thanks to Bruce Payette)<BR/><BR/>function ql{$args}<BR/><BR/>test-luhnnumber (ql 0 6 6 2 4 9 1 8 9 2 3)Doug Finkehttps://www.blogger.com/profile/12254219897657428746noreply@blogger.com