ENH: Add hashing

Ready for review.
seems dangerous, wouldn't it be better to raise an error for StringIO and BytesIO