Fixed sized storage. #61
sergey-shandar
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One file of fixed size which contains a hash-table.
Minimal record (not optimal) has size 64 bytes.
Requirements:
Resizing
Collision resolution
As additional hashing, we can use the rest of 224 hash bits. For example:
In this case, we can validate against all hashes.
https://en.wikipedia.org/wiki/Hash_table#Collision_resolution
Probability to find a slot when the table is 75% occupied:
If it's not enough, we can generate more hash bits. For example
sha512::compress(hash, [0, 0])
will give512
bits. Also, other hash functions can generate as many bits as needed. However, we should have a limit. Otherwise, we will not be able to validate if the record is correct.If we would like to increase the size of a block, we need to store a tree structure.
Beta Was this translation helpful? Give feedback.
All reactions