This is a great question with a lot of room for debate. These are two very ancient law code and a comparison of the two can prove to be extremely insightful. Here are some similarities.
First, they both a very strict. For example, the death penalty is frequently used. For example, in Hammurabi's code if a builder builds a house poorly and it kills a person, then the builder should be put to death. Here is another example. Both in Hammurabi's Code and the Mosaic Code, kidnappers deserve the death penalty. (Exodus 21:16 and 14 in Hammurabi's Code). This framework, according to scholars is called lex talionis. This framework is also found in the Mosaic code. In other words, it is a law of retaliation. This would be one of the greatest similarities.
Second, another very clear similarity is that both codes are divine. We can say that these are God's laws, which people should live by.
With that said, there are differences. One of the starkest differences is the fact there is no mention of sacrifice in Hammurabi's Code.