ISBN13 check digit: Difference between revisions

Line 537:
<lang langur>val .isbn13checkdigit = f(var .s) {
.s = replace(.s, RE/[\- ]/)
var .alt = falsetrue
matching(re/^[0-9]{13}$/, .s) and
for[=0] .d in s2n(.s) { _for += if(not= .alt: .d x 3; .d); not= .alt } div 10
}
 
1,007

edits