Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add distinguishable character set #14

Merged
merged 7 commits into from
Mar 7, 2020

Conversation

markstos
Copy link
Contributor

@markstos markstos commented Jul 9, 2019

This is a port of the "distinguishable" character set from the
distinquishable module, which is not crypto-secure:
https://github.com/komola/distinguishable

Sometimes you need to generate a random "Connect Code" that people need
to type in, and you want to remove all characters which may look
confusingly similar.

@ferbs
Copy link

ferbs commented Aug 22, 2019

@markstos, regarding human-distinguishable characters, the 0 might look like the letter O, as well as 1:l, 5:S, and 8:B depending on the font and up/down case.
@sindresorhus, I'm fine passing in a custom character set but let me know if you'd like a PR for a "human" type that uses a single-case set with these visually confusing chars removed. (28 chars: "acdefghjkmnpqrstuvwxyz234679")

@markstos
Copy link
Contributor Author

@ferbs the character set I proposed to add was "CDEHKMPRTUWXY012458".''

It doesn't contain the conflicting pairs you cite. Because it contains at most one of each pair, a parser can be used to resolve any typos. I linked to such a parser above.

readme.md Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
test.js Show resolved Hide resolved
@sindresorhus sindresorhus changed the title Add "distinguishable" character set. Add distinguishable character set Nov 16, 2019
@sindresorhus
Copy link
Owner

@markstos Bump

@markstos
Copy link
Contributor Author

Revised as requested.

index.d.ts Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

Bump :)

This is a port of the "distinguishable" character set from the
distinquishable module, which is not crypto-secure:
https://github.com/komola/distinguishable

Sometimes you need to generate a random "Connect Code" that people need
to type in, and you want to remove all characters which may look
confusingly similar.
@markstos
Copy link
Contributor Author

Revised as requested.

package.json Outdated Show resolved Hide resolved
@sindresorhus sindresorhus merged commit c047603 into sindresorhus:master Mar 7, 2020
@markstos markstos deleted the add-distinguishable branch March 10, 2020 16:02
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