isMongoId function

bool isMongoId(
  1. String str
)

check if the string is a valid hex-encoded representation of a MongoDB ObjectId

Implementation

bool isMongoId(String str) {
  return (isHexadecimal(str) && str.length == 24);
}