IdChecker
object IdChecker
Content copied to clipboard
This class checks whether a Game- or Player-ID matches the old or new format. If old format is used, checks are skipped and input is returned. If new format is detected, prefix and checkDigit are checked and UUID returned.
All input is returned trimmed.
New format: G-UUID-CheckDigit for Game IDs P-UUID-CheckDigit for Player IDs
Example: 2ddb3a34-0699-4126-b7a5-38603e665928 Same ID in proposed new Player-ID format: P-2ddb3a34-0699-4126-b7a5-38603e665928-5 Same ID in proposed new Game-ID format: G-2ddb3a34-0699-4126-b7a5-38603e665928-5
Functions
checkAndReturnGameUuid
Link copied to clipboard
checkAndReturnPlayerUuid
Link copied to clipboard
checkAndReturnUuiId
Link copied to clipboard
getCheckDigit
Link copied to clipboard
Adapted from https://wiki.openmrs.org/display/docs/Check+Digit+Algorithm
Sources
jvm source
Link copied to clipboard