-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
On the region digits, there is at least one case Metropolitan Lyon which has a letter in the COG.
'69M' => 'Metropolitan Lyon',But the validation algorithm for France will throw a cast error when trying to parse an id that includes that COG.
public function validate(string $id): bool
{
$id = $this->sanitize($id);
$checksum = (int) substr($id, -2);
$id = substr($id, 0, -2);
$result = 97 - ((int) $id % 97); // cast error for an id like 1510269M02043
return $checksum === $result;
}I can't find any documentation on how to perform the control digit calculation for a scenario like that though.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed