Encode for hasher