# Struct crypto::voice::VoiceSessionId

> One participation in a voice channel. A member draws a fresh one on every join, so KIDs and epochs never repeat across joins.

`zaun_community_protocol::crypto::voice::VoiceSessionId` · Struct

```rust
pub struct VoiceSessionId(…)
```

One participation in a voice channel. A member draws a fresh one on every join, so KIDs and
epochs never repeat across joins.

## Methods

### `random`

```rust
pub fn random() -> Result<Self, RngError>
```

A fresh, non-zero session id.

# Errors
`RngError` when the CSPRNG fails.

### `from_bytes`

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

Wraps raw bytes.

### `as_bytes`

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

The raw bytes.

### `to_b64`

```rust
pub fn to_b64(&self) -> String
```

Unpadded base64url, like every other id.

### `from_b64`

```rust
pub fn from_b64(text: &str) -> Result<Self, B64Error>
```

Parses unpadded base64url.

# Errors
`b64::B64Error` for bad text or the wrong length.

## Trait implementations

`Clone`, `Copy`, `Debug`, `Deserialize<'de>`, `Eq`, `Hash`, `Ord`, `PartialEq`, `PartialOrd`, `Serialize`, `StructuralPartialEq`

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/crypto/voice/session/struct.VoiceSessionId.html)
