More idiomatic way to calculate GS1 check digit in Clojure
问题 I am trying to calculate a GS1 check digit and have come up with the following code. The algorithm for calculating a check digit is: Reverse the barcode Drop the last digit (calculated check digit) Add the digits together with first, third, fifth, e.t.c. digit multiplied by 3 and even digits multiplied by 1. Subtract the sum from nearest equal or higher multiple of ten It sounds simple typed out but the solution I came up with seemed a bit inelegant. It does work but I want to know if there