1
0
Fork 0

Support m->d redacting messages and reactions

This commit is contained in:
Cadence Ember 2023-09-25 16:26:48 +13:00
parent 2e68c7edf5
commit 8d3ac665c9
7 changed files with 74 additions and 2 deletions

View file

@ -38,7 +38,7 @@ function getPublicUrlForMxc(mxc) {
/**
* Event IDs are really big and have more entropy than we need.
* If we want to store the event ID in the database, we can store a more compact version by hashing it with this.
* Choosing a 64-bit non-cryptographic hash as only a 32-bit hash will see birthday collisions unreasonably frequently: https://en.wikipedia.org/wiki/Birthday_attack#Mathematics
* I choose a 64-bit non-cryptographic hash as only a 32-bit hash will see birthday collisions unreasonably frequently: https://en.wikipedia.org/wiki/Birthday_attack#Mathematics
* xxhash outputs an unsigned 64-bit integer.
* Converting to a signed 64-bit integer with no bit loss so that it can be stored in an SQLite integer field as-is: https://www.sqlite.org/fileformat2.html#record_format
* This should give very efficient storage with sufficient entropy.