Repository navigation
Say an on-premise Engine whose native code converts high entropy values needs no decoder - #108
Merged
jwrosewell merged 3 commits intoNov 10, 2026
Conversation
The page said Device Detection Engines MUST be able to use the decoder's Element Data, and that the Element is implemented for .NET. Neither holds for an on-premise Engine built on the native code in 51degrees-cxx. - The native code turns 51D_GetHighEntropyValues evidence, from the query string or a cookie, into sec-ch-ua headers before it matches (setGetHighEntropyValuesHeader, src/dd/hash/hash.c lines 3540 to 3556, called from resultsHashFromEvidence_setSpecialHeaders at line 4313), while special evidence processing is on, which is the default (src/dd/config-dd.h line 90), all at 51degrees-cxx e866f6d3cea936587790f87967eff7863778b30e. The C++ Engine accepts both keys (src/dd/EngineDeviceDetection.cpp lines 39 and 41). - 51degrees-dotnet at 4d7152bfcb7c9bcb17d14cb512025b65a3307313, whose cxx submodule is e866f6d3, has no decoder element. Its examples say the engine consumes the values as query or cookie parameters (examples/device-detection/ExampleBase/ExampleUtils.cs lines 620 to 624). - 51degrees-java at f69da52e52104687206d1ca1c3595d2935790f34, with the same cxx submodule, has no decoder element either. The page now says an on-premise Engine whose native code converts the values itself need not read the Element's data, and that a Pipeline built around one does not need the Element. The precedence rule under Process is unchanged. Follows 51Degrees/51degrees-rust#350.
Contributor
Author
|
Added a paragraph to "Engines that convert the values". The native code converts only the first |
This was referenced Nov 8, 2026
Merged
Element Data keeps the statement that .NET and Java have no implementation, the rule that a Flow Element MAY write to Evidence outside a parallel group, and the MUST that reads the values from Element Data, with the exception for an on-premise Engine whose native code converts the values. The new section cites 51degrees-cxx cfad8978, which reads every query value before any cookie value, so it agrees with Accepted Evidence.
jwrosewell
marked this pull request as ready for review
November 10, 2026 19:36
jwrosewell
deleted the
doc/uach-decoder-not-needed-with-native-conversion
branch
November 10, 2026 19:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
uach-high-entropy-decoder.md on
rcat 13642c4 says the decoder Element "is only implemented for .NET at time of writing", that "The reference implementation writes the decoded values to Evidence", and that "The Device Detection Engines MUST be capable of using these values from Element Data if available" (lines 33 to 44). None of the three holds for an on-premise Engine built on the native code in 51degrees-cxx.51D_GetHighEntropyValuesevidence into client hint headers before it matches, so an Engine built on it gets the same answer without the Element.The draft 51degrees-rust#350 leaves the conversion to the C library and stops adding the Rust decoder element to the on-premise pipeline. Its comparison with .NET shows device answers do not change. This pull request changes the specification to match, under the rule that the specification is followed where it is clear, and changes where it is silent or out of date and .NET agrees.
What was checked
The native code, at 51degrees-cxx cfad897, which is the
cxxsubmodule of the .NET and Python repositories onrc.setGetHighEntropyValuesHeaderturns a51D_GetHighEntropyValuesvalue into headers throughTransformIterateGhevFromBase64(src/dd/hash/hash.c lines 3902 to 3920).setSpecialHeadersstops at the first value that gives a header (lines 3949 to 3959).resultsHashFromEvidence_setSpecialHeadersapplies it to every query value first and to the cookie values only when no query value gave a header (lines 4287 to 4305). Detection calls that before it reads the headers to match, whenever the evidence holds no device id (lines 4679 to 4689).processSpecialEvidenceis true, and the default is true (src/dd/config-dd.h line 90).sec-ch-ua(src/dd/transformc.c lines 1105 to 1107).51D_gethighentropyvaluesand51D_structureduseragentunder both thequery.andcookie.prefixes (hash.c lines 5011 to 5019), so an Engine that takes the native key list passes the raw values on.Java, Node, PHP and Go on
rcstill build 51degrees-cxx e866f6d. It converts the values in the same way, but reads query and cookie values together in the order of the evidence (hash.c lines 3922 to 3933), so those languages follow "Accepted Evidence" on query before cookie only once they take cfad897. That gap is not changed by this pull request..NET, at 51degrees-dotnet 4dd312b, its
rcon 10 November.gethighentropyvaluesfinds only theJavascriptGetHighEntropyValuesproperty, examples, tests and configuration.UachJsConversionElementBuilderappears nowhere, and the SWIGTransformclass is used only by the tests.Java, at 51degrees-java ff6e4c0, its
rcon 10 November. No library file is named for a decoder.UACHServiceCoresets the Accept-CH response header and decodes nothing.Change
One file,
device-detection-specification/pipeline-elements/uach-high-entropy-decoder.md. The branch hasrcat 13642c4 merged in, which resolved a conflict with #116 and #119 in the Element Data paragraph.Overview, a new paragraph at the end.
Element Data, the text on
rc.New text. It keeps #116's rule that a Flow Element MAY write to Evidence outside a parallel group, which agrees with evidence.md line 60, and #119's "from Element Data", and adds the exception.
A new section, "Engines that convert the values", between Process and Configuration options. It says the native code converts both keys before it matches while special evidence processing is on, which is the default, that an Engine passing both keys to that code unchanged need not read this Element's data, and that a Pipeline built around such an Engine does not need this Element. Its last paragraph agrees with "Accepted Evidence" (lines 25 to 29 on
rc).The cloud Engines are not covered by the new wording, so the MUST still applies to them as before.
Other drafts
No other open pull request in this repository changes
uach-high-entropy-decoder.md, apart from #134, which bringsrcintomain. #116 and #119 changed it and have merged intorc.Verification
Outstanding
cxxsubmodule moves to cfad897 or later.No version directive is carried.