ENG-4720: Add a utility function to get long from Object for legacy hashinator

The utility function is the same as the code used in TheHashinator, just putting it in a utility class for reuse.