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 (
0x00000001for v1,0x6b3343cffor v2) - the destination connection ID (length + bytes)
- the ordered transport parameters (with
varintlength 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: StringFull JA4Q fingerprint string.
version: u32QUIC version (0x00000001 for v1, 0x6b3343cf for v2).
cilen: u8Initial destination connection ID length (bytes).
transport_parameter_count: usizeNumber of ordered transport parameters captured.
token_present: boolWhether a retry/stateless reset token was present in the Initial.
Implementations§
Source§impl Ja4q
impl Ja4q
Sourcepub fn from_components(
version: u32,
cilen: u8,
cilen_bytes: &[u8],
transport_parameters: &[(u64, Vec<u8>)],
token_present: bool,
) -> Self
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<'de> Deserialize<'de> for Ja4q
impl<'de> Deserialize<'de> for Ja4q
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Ja4q
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.