moved all generateHashValue functions to a common function and removed the duplicates, also a small cleanup and uncrustify the source