Step7750 / ScheduleStorm

University Schedule Generator
http://schedulestorm.com
MIT License
22 stars 3 forks source link

Stateless Schedule Sharing #11

Open Step7750 opened 6 years ago

Step7750 commented 6 years ago

This is a bit of an idea I've been playing around with to store a self-contained version of the schedule being viewed within the URL itself in a stateless manner to enable easy sharing that is completely client side.

If we were to use a binary encoding optimized for UTF-16, we could probably store the entirety of a schedule within a couple of mapped symbols appended to the URL without it being extremely long.

For example, we can use Base65536 (or some other mapping with nicer symbols but a worse bit/char ratio):

As a result, we could encode a schedule into the URL like: schedulestorm.com#UCalgary_2181_𧰘鍇誰𧸂㣬棘

Or in braille encoding: schedulestorm.com#UCalgary2181⡈⡷⢲⡺⡅⣒⠠⡏⠟⠐⡋⣤

We could optionally assign an incrementing ID to each university and/or term, and encode that in binary and use a variable length encoding scheme.

Perplex commented 6 years ago

This seems to make the facebook sharing and imgur uploading redundant. Also sharing a link with chinese or braile encoding in the URL, in my opinion, would seem not that trust worthy.

Step7750 commented 6 years ago

It depends on whether the user wants an interactive copy sent or not. Facebook sharing doesn't allow images anymore, so it only serves to share the site URL now.

For how the encoding looks, we can't do that much better unless the state is stored server side with our own scheme. I'd prefer this stateless approach due to the very little overhead and being able to dynamically change the site URL whenever a user is flipping through schedules. It also brings down any server side attack vectors associated with allowing users to upload things.