Comments (4)
Why not Base64UrlSafe? libsodium has a constant-time implementation of it already, including URL safe variant... also exposed through php-sodium.
from branca-spec.
- Usability, you can double click base62 encoded token to fully select it.
AAAAAAAAA_BBBBBBBBB-CCCCCCCCCC
vs
AAAAAAAAAABBBBBBBBBBCCCCCCCCCC
- Usability, when using
0-9A-Za-z
character set Base62 encoded strings preserve the sort order of the encoded values. Since the timestamp is in the beginning of token the Branca tokens can be sorted by their creation time.
$ branca encode --key supersecretkeyyoushouldnotcommit --payload "foo 1" > test.txt
$ branca encode --key supersecretkeyyoushouldnotcommit --payload "bar 2" >> test.txt
$ branca encode --key supersecretkeyyoushouldnotcommit --payload "pop 3" >> test.txt
$ cat test.txt
1WgabfDGgbzPwVRnRwTBHMOBODseP3p2Mu60FrbbIjfQtq9em2cjptHeouoe8fZj97BO
1WgabfE9f73X78BZPpf6Mmgh7UoW2M6jORCD4Xzcfyta5ukNnGHxI3EEnBRrdkV7fOn9
1WgabfEjdXYAC0H4l4NMHeQBHd2kO6tptlbam8fbZD6LfXxXBXrN4uLoaVMbxBMiiMSk
$ sort --random-sort test.txt
1WgabfE9f73X78BZPpf6Mmgh7UoW2M6jORCD4Xzcfyta5ukNnGHxI3EEnBRrdkV7fOn9
1WgabfDGgbzPwVRnRwTBHMOBODseP3p2Mu60FrbbIjfQtq9em2cjptHeouoe8fZj97BO
1WgabfEjdXYAC0H4l4NMHeQBHd2kO6tptlbam8fbZD6LfXxXBXrN4uLoaVMbxBMiiMSk
$ sort --random-sort test.txt | sort
1WgabfDGgbzPwVRnRwTBHMOBODseP3p2Mu60FrbbIjfQtq9em2cjptHeouoe8fZj97BO
1WgabfE9f73X78BZPpf6Mmgh7UoW2M6jORCD4Xzcfyta5ukNnGHxI3EEnBRrdkV7fOn9
1WgabfEjdXYAC0H4l4NMHeQBHd2kO6tptlbam8fbZD6LfXxXBXrN4uLoaVMbxBMiiMSk
- Aesthetics, I personally do dislike how the
_
and-
characters look in a token, especially when passed in an url or something similar.
There is a small performance hit by using base62 instead of base64, but it is negligible since one should keep the amount data encoded into the token reasonably small anyway.
from branca-spec.
Thanks for taking the time to explain! It may be beneficial to also mention this in the specification itself.
from branca-spec.
Good idea. Maybe some separate design notes document. I try to keep the spec short and concise too.
from branca-spec.
Related Issues (20)
- Clojure implementation HOT 2
- Swift implementation HOT 2
- Known implementations HOT 1
- Another one Golang implementation for Branca HOT 2
- Describe and improve test vectors HOT 10
- DotNet implementation HOT 6
- Dart implementation
- Base62 is actually Base61 HOT 2
- branca.io Website is down HOT 1
- Typo in Ciphertext paragraph of README HOT 1
- Typo on branca.io HOT 1
- Suggestion to optional nonce protection HOT 4
- Suggestion to expiration check HOT 1
- Missing License file
- Timestamp is not protected against tampering HOT 2
- README and test vectors should reflect new 32 byte hex key expectations from branca-js HOT 18
- Crystal implementation
- The website http://branca.io is dead HOT 1
- Erlang implementation HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from branca-spec.