Skip to content

Conversation

@jjb
Copy link

@jjb jjb commented Apr 22, 2024

A method to generate from more or less the entire "typable" space.

This is the sort of thing I might use if I need to generate a random password for a user.

I tried to name it in order of increasing specificity. maybe the name should be nicer to type.

I think the regex in the test is correct.

I implemented it using alphanumeric instead of choose to avoid repeating code.

Let me know what you think!

https://www.ascii-code.com/

see also: #3

jjb and others added 2 commits April 22, 2024 02:33
Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com>
Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com>
@jjb
Copy link
Author

jjb commented Apr 22, 2024

@olleolleolle thanks!

@jjb
Copy link
Author

jjb commented Apr 29, 2024

@nobu @hsbt what do you think?

@nobu
Copy link
Member

nobu commented May 18, 2024

What do you intend by “printable visible”?
Doesn’t “visible” imply “printable”?

@nobu
Copy link
Member

nobu commented May 18, 2024

Random::Formatter#alphanumeric was designed so that any character set can be used as an option..
To be honest, I don't think it's a good idea to add methods for every possible character set.

BTW, I think !..~ is called a "graph" in C and POSIX terminology.

@jjb
Copy link
Author

jjb commented May 18, 2024

What do you intend by “printable visible”? Doesn’t “visible” imply “printable”?

“Printable” comes from the ascii spec

here I include everything in that range except for white space

happy to use a different name!

To be honest, I don't think it's a good idea to add methods for every possible character set.

sure - my proposal is just an idea for what is a common need for me and I thought maybe others. To generate a secret string with letters, numbers, and symbols. For example to meet password requirements.

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.

3 participants