Content
@
https://warpcast.com/~/channel/fc-devs
0 reply
0 recast
0 reaction
christopher
@christopher
So open mental note here to not get clever and use the first 6 characters of a cast because it will collide.. i.e. 0xabcdef vs. 0xabcdef12 π Collision probability with 100,000 casts: - 6 characters: ~37% chance of at least one collision. - 8 characters: ~0.12% chance of at least one collision.
1 reply
0 recast
14 reactions
christopher
@christopher
Donβt learn the hard way.
1 reply
0 recast
2 reactions
artlu π©
@artlu
isn't the idea that the username is part of the shorthash?
2 replies
0 recast
0 reaction
christopher
@christopher
Warpcast uses it but it's not necessary. Likely a faster way to find the exact cast hash.
0 reply
0 recast
1 reaction
Andrei O.
@andrei0x309
No, username is not part of the hash but is part of the query. They use both the username and short hash, which practically forms a composite key with improbable collision. They could use the full hash as @christopher says, also a composite key can be faster, but not in all scenarios. It can also be slower depending on DB and implementation, and it also might require additional storage with little benefit. What I think is the real reason is that they wanted to have a nice URL, that doesn't contain the hash in full form. Again without full source code, everything related to the client is speculation.
1 reply
0 recast
1 reaction