TWCManager icon indicating copy to clipboard operation
TWCManager copied to clipboard

Add VIN check digit validation

Open MikeBishop opened this issue 2 years ago • 0 comments

TWCManager has (very occasionally) gotten the incorrect VIN from my TWC, which I can tell from the Vehicle history showing both my correct VIN with many charging sessions and a very similar VIN with 2 charging sessions.

VINs include a check digit which can be used to confirm the VIN is valid. We should consider adding a check digit computation once the full VIN is received and discarding the result if the check digit fails validation. (Note that the check digit computation for all-zeroes computes, so we don't need to special-case that.)

MikeBishop avatar Nov 08 '22 18:11 MikeBishop