Questions tagged [hashtree]

16 questions
404
votes
7 answers

C++ unordered_map using a custom class type as the key

I am trying to use a custom class as key for an unordered_map, like the following: #include #include #include using namespace std; class node; class Solution; class Node { public: int a; int b; …
Alfred Zhong
  • 6,773
  • 11
  • 47
  • 59
8
votes
1 answer

Merkle Tree Data Synchronization False Positives

Merkle trees (aka hash trees) are used for data synchronization in both "Cassandra" & "Dynamo". As with any hash function, there is a probability that different data can have the same hash value: There exists an x and y where [y!=x] but [hash(x) =…
eshalev
  • 3,033
  • 4
  • 34
  • 48
8
votes
1 answer

Reverse tree building (with an odd number of children)

I just found out about the AWS Glacier service and wanted to write a small Python application to upload files via the REST API. I took a look at the required headers and stumbled upon x-amz-sha256-tree-hash. I need to calculate the SHA-256 hash of…
Paul
  • 1,295
  • 2
  • 11
  • 26
5
votes
1 answer

Any Java hash tree implementations?

I want to implement an algorithm that needs to use a hash tree. What are some good, easy-to-understand Java hash tree implementations? Are there books, websites or PDFs on the Internet that give a good explanation on how a hash tree works and how I…
Phil
  • 3,375
  • 3
  • 30
  • 46
5
votes
2 answers

Merkle tree vs hash list

What is the advantages of using Merkle trees over Hash lists? A hash list is a 2-level structure, Merkle tree is log n - level structure. Both can be used to verify if one of the nodes has changed. Hash list will accomplish this faster. So why ever…
Nick Borodulin
  • 3,065
  • 4
  • 21
  • 21
3
votes
1 answer

I'm trying to implement a merkle tree consistency proof, but I'm stuck at understanding the algorithm

I'm trying to implement a merkle tree consistency algorithm with this paper: https://books.google.de/books?id=CokSDQAAQBAJ&lpg=PA147&dq=merkle%20consistency%20proof&hl=de&pg=PA148#v=onepage&q&f=false However, I am kinda stuck on the consistency…
Sossenbinder
  • 4,852
  • 5
  • 35
  • 78
2
votes
1 answer

How can I convert/transform a JSON tree structure to a merkle tree

I'm running a web server, where I receive data in JSON format and planning to store it in a NoSQL database. Here is an example: data_example = { "key1": "val1", "key2": [1, 2, 3], "key3": { "subkey1": "subval1", . …
basilisk
  • 1,156
  • 1
  • 14
  • 34
1
vote
2 answers

How to do conditional eager_loading in ActiveRecord?

I have a model Tag, which is a tree model (using closure_tree) and thanks to the gem I can do stuff like: Tag.includes(:children).first to eager load its children. Now, I have an instance method, which also uses children. So when I get a tag by the…
Alexander Popov
  • 23,073
  • 19
  • 91
  • 130
1
vote
1 answer

why ext4 filesystem choose to use HTree as there extent's tree structure

From ext4 wikipedia introduction, I found the Htree was used in ext4 for both Directory organization and the extents organization. In directory organization scenario, Hash Table Tree can help to balance and improve search. but what is the benefit to…
Chinaxing
  • 8,054
  • 4
  • 28
  • 36
0
votes
1 answer

In a hash tree, are non-leaf nodes direct hashes of data, or are they hashes of sub-hashes?

I am looking on the wikipedia article for hash trees, and I am slightly confused by their diagram. A leaf node obviously contains the hash of the underlying data. Are leaf nodes in hash trees different than any non-leaf node? Do non-leaf nodes…
Merlyn Morgan-Graham
  • 58,163
  • 16
  • 128
  • 183
0
votes
1 answer

Hash Tree (Merkle Tree) error localization question for 128 data blocks

For a hash tree that covers 128 data blocks, how many hash checks do you need to perform to localize the error? Assume that error occurred on only one block.
0
votes
1 answer

MVN jmeter Hashtree I/O error for running through java code

Pretty new to jmeter and i am trying to Run an existing JMeter Test from Java code i read from the link below. https://www.blazemeter.com/blog/5-ways-launch-jmeter-test-without-using-jmeter-gui But when i try to follow the instruction im getting a…
0
votes
1 answer

Scheduled Calendar in Java

Could someone explain where the inputs would come from in this skeleton code. The skeleton code is as follows: Data.java import java.util.Date; import java.util.List; public interface Data { // Return a list of all appointments at the given…
Ryota
  • 11
  • 1
  • 7
0
votes
1 answer

Reading a 3-candidate hash tree structure

I am trying to figure out how to properly navigate a hash tree structure given a certain transaction. I already have the answer to the question, but I'm not entirely sure how they arrived at it. Here is a link to the hash tree structure Question:…
0
votes
1 answer

Extendible hashing with similar keys

Is it possible for a single insert into an extendible hash to result in multiple directory doubles? All the online resources I could find only demonstrate cases where only a single double is necessary. Consider the example using the MSB of keys: | 0…
1
2