I am looking for a formula that I can link to a button to generate random passwords that fit the following; 12 characters, upper and lower case, numbers and special characters. I have found a few excel ones but they are very limited and will not do much. I am hoping someone has done this before. Thanks for any help!
@Jono_Bouwmeester could probably give you some great direction
I never challenged myself to build a password generator in Coda, mainly because it’s not intended to fulfill such a task for various reasons, while Coda has strengths in many other areas as advertised.
For a password generator / storage, I am using and can recommend the open source https://bitwarden.com/
The code is public available available, audited on a regular basis to keep up the standard and security.
Other tools are LastPass, keeper, dashlane and with some research you will find a ton of offers that might suit you.
Keep building with Coda
Thanks for the comment. I should have provided some more context. I am wanting to use this to assign users their passwords meeting the criteria I set. Currently I have a solution for this that works perfectly and I have generated over 200 using that but since I use coda for most things and I was wanting to make a button to generate it without having to go to a separate workspace. I work in coda almost all day and if I can do it with coda, I try to. Thanks again for the response.
Thank you @Scott_Collier-Weir i will check out his page and see what I can find.
Hi gents, sorry for the late reply!
It’s really efficient, and will generate a ton of passwords quickly, however they may not necessarily meet your requirements every time so you’ll need to built in some way to validate the output before acceptance (I’ve got a second solution further down which will meet your requirements)
Split("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-=+", "") .RandomSample(12, False(), True()) .Join("")
How this works…
- Passing a blank string ("") to the Split() formula takes the string of characters and breaks them up into an array of individual characters.
- Next we pass that array to RandomSample() which is a formula which picks a set number of random items out of whatever array you pass it. In this case we request 12 items.
- Finally, we Join() the randomly picked characters together. The empty string means that the characters are glued together without any delimiter.
The False() and True() arguments for RandomSample() are options for withReplacement and updateContinuously (respectively).
withReplacement set to false means that characters are not allowed to potentially repeat in the random sample. If you’re ok with having a letter potentially repeat in the output, set this to true.
updateContinuously will generate new random samples whenever the doc loads, so you’re more likely to get unique results. Note however, you’ll need to STORE the output, otherwise your users passwords will change each time the doc is loaded!
If you wanted to generate these using a button, then the formula for the button would be something like:
thisRow.ModifyRows( thisRow.Password, Split("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-=+_", "") .RandomSample(12, False, True) .Join("") )
If you wanted to ENSURE upper/lower/special in ALL outputs, a solution could be to repeat the above code 3 times with separate strings passed for the three character categories, then join the whole bunch together. I’ve built a doc to show you both solutions.
Hope that helps!
once again an excellent approach and a great explanation
Thanks gents Learned so much from that last doc, it’s fun to have some code handy that can help other people. Lord knows I’ve stolen code from both @Christiaan_Huizer and @Xyzor_Max more times than I can count haha
This is amazing! Exactly what I was needing. Thank you so much for sharing this great information. It worked perfectly and allowed me to make the passwords I needed without having to go to a separate site.
Ah that’s fantastic. So glad it was useful to you @Terry_Stagg.