move do_sim and hash_256 to separate module