MCPcopy Create free account
hub / github.com/Gegam/redpill / grease_value

Function grease_value

crates/redpill-quic/src/browser_profile.rs:132–136  ·  view source on GitHub ↗

Generate a GREASE value (0x?A?A pattern). Real browsers include random GREASE values; their absence is a strong signal of non-browser clients.

()

Source from the content-addressed store, hash-verified

130/// Real browsers include random GREASE values; their absence is a strong
131/// signal of non-browser clients.
132pub fn grease_value() -> u16 {
133 let idx = rand::random::<u8>() % 16;
134 let nibble = idx as u16;
135 (nibble << 12) | (0x0A << 8) | (nibble << 4) | 0x0A
136}
137
138/// Generate a GREASE cipher suite value (RFC 8701).
139pub fn grease_cipher_suite() -> u16 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected