Git Product home page Git Product logo

heteroglyphs's Introduction

heteroglyphs

A list of (and some sample code for) non-confusable/non-homoglyphs - i.e. characters appropriate for use when humans need to manually enter ASCII codes and you don't want them using confusing similar looking letters.

In an effort to maximize the number of characters one can use and minimize human errors, here are the ASCII non-confusables, henceforth known as heteroglyphs (similarity will change based on the typeface).

Single character ASCII confusables/homographs:

  • b ⇔ 6
  • B ⇔ 8
  • G ⇔ 6
  • g ⇔ 9
  • g ⇔ q
  • L, l ⇔ I, 1
  • O, o ⇔ 0
  • S, s ⇔ 5
  • V, v ⇔ U, u
  • Z, z ⇔ 2

Multi-character ASCII confusables/homographs:

  • a ⇔ ci
  • A ⇔ fi
  • B ⇔ l3
  • d ⇔ cl
  • g ⇔ cj
  • m ⇔ rn
  • W ⇔ VV

I we want to prevent most of the multi-character homographs from being possible, we can limit ourselves to upper case letters and numbers and end up with a list of 19 possible characters in upper case (0125689BGILOSUVWZ are banned):

347ACDEFHJKMNPQRTXY

Realistically we should also exclude vowels to prevent us from accidentally generating offensive words, so let's trim this down to the following 17 characters:

347CDFHJKMNPQRTXY

Alternately we can follow the Microsoft permitted character licensing scheme, then we have a list of 24 characters (015AEILNOSUZ are banned):

2346789BCDFGHJKMPQRTVWXY (note, some obvious confusables exist here such as B/8 and G/6)

Footnote

This whole codebase requires about 3 minutes of coding. But it also requires a few hours of research and as I've done this three times over the years so far, I decided to just save it to a repo.


Thanks to the Unicode Consortium:

heteroglyphs's People

Contributors

mattpavelle avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.