Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "shortlink"
-
Can we talk about Google Allo for a second?
What the everloving f*ck, Google? I don't get it. You built a perfectly solid, pretty chat app with lots of neat features and interesting ideas. And then you ruin it by completely neutering SMS support.
Here's (roughly) what your recipient gets when you message someone who isn't on Allo:
(Allo)(Name): <message> Send STOP to stop Allo messages. Download Allo here: <shortlink>
iMessage figured out SMS integration three f*cking years ago, how could you guys have messed this up so bad?
</rant>8 -
Remember I wanted to do a small web app but found out there were already 5 or so which did the same thing and got discouraged and you lot cheered me to do it anyway?
It's a web app to get a diff from two texts, with the ability to save the diff and get a shortlink to it :)
Enjoy: https://finddiff.com1 -
How do you approach generating "random" unique numbers/strings ? Exactly, when you have to be sure the generated stuff is unique overtime? Eg. as few collisions in future as possible.
Now I don't mean UUIDs but when there is a functionality that needs some length defined, symbol specific and definitely unique data, every time it does it's stuff.
TLDR STORY: Generating 8 digits long numbers so they are (deterministically - wink wink) unique is hard but Format Preserving Encryption saves the day. (for me)
FULL STORY:
I had to deal with both strings and codes today.
One was to generate shortlink word for url, luckily found a library that does exactly this. (Hashids)
BUT generating 8 digits long, somewhat random number was harder then I thought, found out on SO something like "sha256(seed) => bytes => ascii/numbers mangling" but that had a lot of collisions because of how the hash got mangled to actually output numbers and also to fit the length.
After some hours I stumbled upon Format Preserving encryption (pyffx) and man it did what I wanted and it had max 2 collisions in 100k values. Still the solution with this feels hacky af. (encrypting straddled unix timestamp with lots of decimals)6 -
Implementing a third-party link shortner:
link.performance=-400ms; link.privacyFactor=-10;
link.ownership=externalProvider;
Keep hyperlinks in-house. Keep ’em fast. Fight the good fight.