in reply to hash to text

I'm actually a little unsure of what you're trying to do. The other posts are all helpful for fixing the bugs in what you presented. May be you can tell us what you're trying to do? it sounds quite interesting.