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

Change to base62 encoding #1

Open
2 tasks
srikrsna opened this issue Jan 31, 2019 · 5 comments
Open
2 tasks

Change to base62 encoding #1

srikrsna opened this issue Jan 31, 2019 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers In Progress
Milestone

Comments

@srikrsna
Copy link
Contributor

srikrsna commented Jan 31, 2019

The current implementation uses an optimised Crockford's base32 encoding (A-Z, 0-9) that is url safe. However due to the limited character set the ids are too long and potentially take up more space. It would be nice if it could be changed to a base64 (url safe) but unfortunately we lose the ability to select a the whole id using a cursor because separation characters like '.'

Hence this should be changed to a base62 notation i.e. (A-Z, a-z, 0-9).

Tasks:

  • Add a function to convert []byte to string of base62
  • Add a function to parse string in to a []byte
@srikrsna srikrsna added enhancement New feature or request To do Planned labels Jan 31, 2019
@srikrsna
Copy link
Contributor Author

@appointy/golang

@srikrsna srikrsna self-assigned this Jan 31, 2019
@srikrsna srikrsna pinned this issue Jan 31, 2019
@srikrsna srikrsna unpinned this issue Jan 31, 2019
@srikrsna srikrsna added this to the v1.1 milestone Jan 31, 2019
@issue-sh issue-sh bot added the In Progress label Jan 31, 2019
@srikrsna srikrsna added good first issue Good for newcomers and removed To do Planned labels Jan 31, 2019
@srikrsna srikrsna changed the title Change from base32 to base62 encoding. This potentially allows for shorter ids. Change from base32 to base62 encoding. Jan 31, 2019
@srikrsna srikrsna changed the title Change from base32 to base62 encoding. Change from base32 to base62 encoding Jan 31, 2019
@srikrsna srikrsna changed the title Change from base32 to base62 encoding Change to base62 encoding Jan 31, 2019
@imnikhil27
Copy link

We can use this library as it also uses timestamp and randomness to generate id and uses base 62 encoding.
https://github.com/segmentio/ksuid

@srikrsna
Copy link
Contributor Author

Create a Merge request without breaking any tests and API using the new package. If it can work we will use it. Also make sure compare the benchmarks.

@srikrsna
Copy link
Contributor Author

srikrsna commented Feb 4, 2019

@imnikhil27 Update?

@imnikhil27
Copy link

In process sir

@srikrsna srikrsna removed their assignment Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers In Progress
Projects
None yet
Development

No branches or pull requests

2 participants