You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Drift takes the smallest component's drift where the specification adds them #16
DeviceDataHashDefault.getDriftInternal returns the smallest drift among the native results, which hold one result per component, starting from Integer.MAX_VALUE (DeviceDataHashDefault.java#L178-L186).
The specification's match metrics table describes Drift as the total difference in character positions (device-detection-on-premise.md), and 51Degrees/specifications#39 says it in full: the drift of every component's result added together, never the largest or smallest alone. The C++ results add them (ResultsHash.cpp#L183-L192), and so do Go and the Node, PHP and Python wrappers, so the same evidence gives a smaller Drift here than in those implementations whenever more than one component drifted. Difference, Iterations and MatchedNodes in the same class already add the results.
What to change
Add the results' drift, as getDifferenceInternal does, and cover it with a test that gives two mocked native results different drifts and reads getDrift.
Activity
oleksandrlazarenko-pi commentedon Nov 11, 2026
Reviewed and approved. The fix (#60, merged into
rc) is correct; nothing critical found.