Skip to main content

Ja4q

Struct Ja4q 

Source
pub struct Ja4q {
    pub fingerprint: String,
    pub version: u32,
    pub cilen: u8,
    pub transport_parameter_count: usize,
    pub token_present: bool,
}
Expand description

QUIC-stack fingerprint value, sibling to Ja4.

Where JA4 fingerprints the TLS handshake (ClientHello), JA4Q fingerprints the QUIC Initial packet that opens the connection. The QUIC Initial carries:

  • the QUIC version (0x00000001 for v1, 0x6b3343cf for v2)
  • the destination connection ID (length + bytes)
  • the ordered transport parameters (with varint length prefix stripped)
  • the initial packet number
  • whether a token is present

Wire form: "q<version_hex>_<cilen_hex>_<truncated_params_hash>_<init_pkt_hash>".

Reference values for Chrome 136, Firefox 130, and Safari 18 are provided as &str constants below; use Ja4q::from_components to compute a value at runtime from the raw QUIC Initial packet, or TlsProfile::ja4q for the family-default value.

§Example

use stygian_browser::tls::{CHROME_136_JA4Q, Ja4q};

// Round-trip: the reference constant is a well-formed JA4Q fingerprint.
let parsed = Ja4q::from_components(0x00000001, 8, &[0u8; 8], &[], false);
assert_eq!(parsed.version, 0x0000_0001);
assert_eq!(parsed.cilen, 8);
assert_eq!(parsed.transport_parameter_count, 0);
assert!(!parsed.token_present);
// The Chrome 136 reference constant matches the fingerprint computed
// by the bundled Chrome profile at runtime — see the unit tests.
assert!(CHROME_136_JA4Q.starts_with("q00000001_"));

Fields§

§fingerprint: String

Full JA4Q fingerprint string.

§version: u32

QUIC version (0x00000001 for v1, 0x6b3343cf for v2).

§cilen: u8

Initial destination connection ID length (bytes).

§transport_parameter_count: usize

Number of ordered transport parameters captured.

§token_present: bool

Whether a retry/stateless reset token was present in the Initial.

Implementations§

Source§

impl Ja4q

Source

pub fn from_components( version: u32, cilen: u8, cilen_bytes: &[u8], transport_parameters: &[(u64, Vec<u8>)], token_present: bool, ) -> Self

Compute a JA4Q fingerprint from raw QUIC Initial components.

version is the QUIC version field, cilen is the destination connection ID length, cilen_bytes is the destination connection ID (must be at least cilen bytes), transport_parameters is the ordered (id, value) list (varint length stripped), token_present is true iff a retry/stateless reset token is present.

§Panics

Panics if cilen_bytes.len() < cilen as usize. Callers should extract exactly cilen bytes from the packet header before calling.

Trait Implementations§

Source§

impl Clone for Ja4q

Source§

fn clone(&self) -> Ja4q

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Ja4q

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Ja4q

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Ja4q

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Ja4q

Source§

impl PartialEq for Ja4q

Source§

fn eq(&self, other: &Ja4q) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Ja4q

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Ja4q

Auto Trait Implementations§

§

impl Freeze for Ja4q

§

impl RefUnwindSafe for Ja4q

§

impl Send for Ja4q

§

impl Sync for Ja4q

§

impl Unpin for Ja4q

§

impl UnsafeUnpin for Ja4q

§

impl UnwindSafe for Ja4q

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more