Compute-Hash function implemented

Now the code is bit cleaner for reuse.
fixes issue #20