Skip to content

Conversation

@skshetry
Copy link
Collaborator

@skshetry skshetry commented Jan 9, 2024

Python>=3.6 has secrets.token_urlsafe that can create cryptographically safe strings/numbers. So we don't need to use shortuuid. The generated text string is of the same size as shortuuid.uuid(), but can contain underscore and hyphen characters (not just alpha-numeric values), which might make it less human-readable. But I am not sure if it's worth it to use a third-party library (which can be gradually removed).

token_urlsafe is also 4x faster than shortuuid.uuid().

Python>=3.6 has secrets.token_urlsafe that can create cryptographically
safe strings/numbers. So we don't need to use shortuuid.
The generated text string is of the same size as `shortuuid.uuid()`,
but can contain underscore and hyphen characters (not just alpha-numeric values),
which might make it less human-readable. But I am not sure if it's worth it to use
a third-party library (which can be gradually removed).
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6e80fbe) 63.37% compared to head (0c6f275) 63.35%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #269      +/-   ##
==========================================
- Coverage   63.37%   63.35%   -0.02%     
==========================================
  Files          26       26              
  Lines        2105     2104       -1     
  Branches      336      336              
==========================================
- Hits         1334     1333       -1     
  Misses        720      720              
  Partials       51       51              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@skshetry skshetry merged commit 63ed7de into main Jan 9, 2024
@skshetry skshetry deleted the remove-shortuuid branch January 9, 2024 08:09
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.

2 participants