Moved hashing function outside of the method.  Will eventually refactor to support user specified hash algo