Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
def luhn? n;s=0;n.size.times{|i|x=n[-(i+1),1].to_i*(i%2+1);s+=x>9?x+1:x};s%10==0;end
@laserlemon
def luhn? n;s=0;n.size.times{|i|x=n[-i-1,1].to_i*(i%2+1);s+=x>9?x+1:x};s%10==0;end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.