How to easily get consistent object hash?

Had a little chat with original Crystal::Hasher author and he proposed just to do

hasher = Crystal::Hasher.new(1, 1)
foo.hash(hasher).result

It works and it’s consistent and fast, but the result will differ on different machines due to little-big-endians thing. And it’s not suitable for my purposes, unfortunately…