checksum

open fun checksum(ean: String): Int

Calculates the checksum of an given ean string.

See https://en.wikipedia.org/wiki/International_Article_Number_(EAN)

Return

returns integer from 0, 9. -1 if the input String is not a string of all digits.

Parameters

ean

A string of digits