Skip to content

Commit

Permalink
Add SessionId new_unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
bitfl0wer committed Mar 3, 2024
1 parent 3e16b75 commit f7a1310
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/certs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ impl SessionId {
session_id.validate()?;
Ok(session_id)
}

/// Creates a new [SessionId] without validating it. This is useful when you are certain that
/// the [SessionId] is valid and you want to avoid the overhead of validation, or if you are
/// creating an extension for polyproto where the [SessionId] is allowed to be longer than 32
/// characters.
pub fn new_unchecked(id: Ia5String) -> Self {
Self { session_id: id }
}
}

#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
Expand Down

0 comments on commit f7a1310

Please sign in to comment.