Skip to content

mask returns invalid result for ISBN with 0 idx #143

@mgradalska

Description

@mgradalska

When I'm trying to mask 9786129999999 ISBN

mask('9786129999999')

it results in string with doubled separator:

'978-612--999999-9'

It doesn't look correct to me. I think the culprit here is that in this part of code

[group, ib[cur + 1:cur + idx + 1], ib[cur + idx + 1:-1], check])

the second entry in the list is ib[6:6] (since idx is 0) and it returns an empty string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions