Skip to content

fix(other): reject lengths shorter than required chars in password ge… - #1

Open
apoppa17 wants to merge 1 commit into
masterfrom
fix-alternative-password-length
Open

apoppa17 wants to merge 1 commit into
masterfrom
fix-alternative-password-length

Conversation

@apoppa17

Copy link
Copy Markdown
Owner

Fix invalid length handling in alternative password generator

…nerator

alternative_password_generator returned passwords longer than the
requested length when len(chars_incl) > i, because the negative
remainder math still added characters. Raise ValueError instead and add
doctests covering valid and invalid input.

Fixes TheAlgorithms#15633

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant