Its issuance is the responsibility of the governments of the federative units of Brazil and are valid nationwide. (wikipedia) Generation an Validation of RG Brazilian identity cards can be used as travel documents to enter the Mercosul countries. Other national documents can legally be used as an identity card, such as a federative unit-issued driver's license, passport or, for minors, a birth certificate. The card contains the name, birthdate, parents' names, signature and thumbprint of the bearer.
It is often informally called carteira de identidade (identity card), "RG" (from Registro Geral, General Registry) The cédula de identidade is the official national identity document in Brazil.
Generated RG's are possibly not even real and shouldn't be used on attempt of any illegal activity.
The alghorythm used to generate the RG code is the same that guarantees basic authentication on website forms, as it merely follows a given pattern.