Skip to content

Conversation

@dhermes
Copy link
Contributor

@dhermes dhermes commented Dec 13, 2017

This PR removes {'i', 'I', 'l', 'o', 'O', '0', '1'} from the set of characters used in automatically-generated IDs, because it is easy to mis-read them if you are in a situation where you need to do that.

Exact set of blacklisted characters is loaned from Django's make_random_password.

/cc @schmidt-sebastian


Was #4107

Luke Sneeringer and others added 2 commits December 13, 2017 15:23
This way the entropy is preserved after dropping the alphabet
from 62 to 55 characters:

  >>> (62. / 55.)**20
  10.979435205204474
  >>> 55**20 < 62**20 < 55**21
  True
@dhermes dhermes added api: firestore Issues related to the Firestore API. type: cleanup An internal cleanup or hygiene concern. labels Dec 13, 2017
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 13, 2017
@dhermes
Copy link
Contributor Author

dhermes commented Dec 14, 2017

@lukesneeringer This is the 3rd time you or I have sent this PR (once was in a private repo) 😀

The previous two were a no-go because we were waiting for a thumbs up from the Firestore team.

@chemelnucfin
Copy link
Contributor

@lukesneeringer @dhermes My fault. I just thought it has been approved and was just sitting, so I merged it.

@chemelnucfin chemelnucfin added do not close do not merge Indicates a pull request not ready for merge, due to either quality or timing. status: awaiting information and removed do not close do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Dec 14, 2017
@lukesneeringer
Copy link
Contributor

@dhermes This is a pretty minor change. Either merge it or close it and let's move on with our lives. :-)

self.assertEqual(result, mock_result)

mock_calls = [mock.call(_AUTO_ID_CHARS)] * 20
mock_calls = [mock.call(_AUTO_ID_CHARS)] * 21

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@dhermes dhermes closed this Dec 21, 2017
@dhermes dhermes deleted the autoid-no-confusing-chars branch December 21, 2017 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: firestore Issues related to the Firestore API. cla: yes This human has signed the Contributor License Agreement. status: awaiting information type: cleanup An internal cleanup or hygiene concern.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants