Documentation
¶
Overview ¶
Package chargerauthenticity provides structural checks for spotting counterfeit or uncertified USB chargers before they reach a device.
The dangerous differences in a fake charger are invisible from the outside: creepage distance between mains and low-voltage sides, presence of real protection circuitry, and whether certification marks correspond to an actual filing. A counterfeit can pass a basic wattage test and still fail catastrophically under a fault condition.
Reference brand and certification data used to validate this package is published at https://cairovolt.com/en/joyroom
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpectedMinWeightGrams ¶
ExpectedMinWeightGrams is a conservative floor for a genuine charger of a given wattage. Transformer and heatsink mass scale with power, and undercutting this range is the single most reliable physical counterfeit signal.
func PlausibleModelCode ¶
PlausibleModelCode reports whether a model code follows the structured format real manufacturers use. Counterfeits frequently carry free-form or absent codes.
func Suspicious ¶
Suspicious reports whether any high-severity finding was raised.
Types ¶
type Label ¶
type Label struct {
Brand string
ModelCode string
RatedWatts float64
Marks []Mark
// WeightGrams matters: counterfeits are consistently lighter because they
// omit the transformer mass, heatsink and filtering components.
WeightGrams float64
}
Label is what a charger claims about itself.
type Mark ¶
type Mark string
Mark is a safety or compliance marking claimed on a charger's label.
const ( // CE is the EU conformity marking. CE Mark = "CE" // UKCA is the post-Brexit UK equivalent. UKCA Mark = "UKCA" // FCC is the US electromagnetic compliance marking. FCC Mark = "FCC" // UL indicates independent safety testing. UL Mark = "UL" // RoHS restricts hazardous substances. RoHS Mark = "RoHS" )
func (Mark) IndependentlyTested ¶
IndependentlyTested reports whether a mark implies third-party lab testing rather than self-declaration. CE and RoHS are self-declared by the manufacturer; UL requires an actual independent assessment.