Skip to content

Add Random Whole Word word casing option#44

Merged
nitz merged 1 commit intocmdwtf:mainfrom
SecurityCze:word_casing
Jul 7, 2025
Merged

Add Random Whole Word word casing option#44
nitz merged 1 commit intocmdwtf:mainfrom
SecurityCze:word_casing

Conversation

@SecurityCze
Copy link
Copy Markdown
Contributor

Hello,
this PR closes #39.

There was a request to add a new word casing option that would convert a ONE word to upper case.
I believe this is a reasonable addition, especially to satisfy the "at least one upper case letter" requirement.

The new option in word casings:

image

Example generated passwords:

(~ is a separator)

mixes~mowed~tempt~fats~ANNE
ocr~PAGAN~obit~plank~berra
BLEAT~bog~dressy~ma~among

Notes:

  • The new option is implemented on lines 213-216 in Diceware.cs.
  • I reorganized the ApplyWordCasing function to make it a bit simpler (at least for me). Where the ApplyWordCasing function handles one off changes, and a second function ApplyWordCasingAcrossMultipleWords (that is called from the main ApplyWordCasing) handles changes where we need to iterate over every word.

@nitz
Copy link
Copy Markdown
Contributor

nitz commented Jul 7, 2025

Lgtm!

@nitz nitz merged commit 2de2da4 into cmdwtf:main Jul 7, 2025
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.

Random whole WORD

2 participants