added helper function for legacy hash