From f72ecfd906d4e8c0d0f2d55d7530422570a6b546 Mon Sep 17 00:00:00 2001 From: Andrea Brighi Date: Sun, 14 May 2023 17:26:30 +0200 Subject: [PATCH] docs(desktop): update ISBNPolicy's documentation --- .../desktopdomain/policies/ISBNPolicy.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desktopDomain/src/main/kotlin/com/intelligentbackpack/desktopdomain/policies/ISBNPolicy.kt b/desktopDomain/src/main/kotlin/com/intelligentbackpack/desktopdomain/policies/ISBNPolicy.kt index 671bb0cd..5f0c3cbc 100644 --- a/desktopDomain/src/main/kotlin/com/intelligentbackpack/desktopdomain/policies/ISBNPolicy.kt +++ b/desktopDomain/src/main/kotlin/com/intelligentbackpack/desktopdomain/policies/ISBNPolicy.kt @@ -11,9 +11,9 @@ object ISBNPolicy { * Checks whether the ISBN is valid. * An ISBN is valid if it is a string of 13 digits that starts with 978 or 979 ends with a check digit. * The check digit is calculated as follows: - * - multiply each digit by 10 minus its position in the string (skipping the first 3 digits) from right to left; - * - sum all the results; - * - the check digit is the number that must be added to the sum to make it divisible by 11. + * - Multiply each digit by 1 or 3 depending on the position of the digit (even or odd). + * - Sum all the results. + * - The check digit is the number that must be added to the sum to make it divisible by 10. * * @param isbn the ISBN to check. * @return true if the ISBN is valid, false otherwise.