# Struct envelope::BodyHash

> SHA3-256 of a command's `body` JSON text **exactly as received**: reformatting the same JSON gives a different hash, which is why retries must resend byte-identical bodies.

`zaun_community_protocol::envelope::BodyHash` · Struct

```rust
pub struct BodyHash(…)
```

SHA3-256 of a command's `body` JSON text **exactly as received**: reformatting the
same JSON gives a different hash, which is why retries must resend byte-identical bodies.

## Methods

### `of`

```rust
pub fn of(body: &RawValue) -> Self
```

Hashes a received body.

### `of_text`

```rust
pub fn of_text(text: &str) -> Self
```

Hashes body JSON text.

### `from_bytes`

```rust
pub const fn from_bytes(bytes: [u8; 32]) -> Self
```

Wraps a stored hash.

### `as_bytes`

```rust
pub const fn as_bytes(&self) -> &[u8; 32]
```

The digest bytes, for storage.

## Trait implementations

`Clone`, `Copy`, `Debug`, `Eq`, `Hash`, `PartialEq`, `StructuralPartialEq`

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/envelope/idempotency/struct.BodyHash.html)
