Official documentation about User Extensions: link
The source-code of this user extension was created by Maurício Avellar and shared in this link http://www.seuenium.com.br/2009/05/20/novos-comandos-do-selenium-para-gerar-cpf-e-cnpj/ (unfortunately this is not working anymore).
The code was refactored to accept the Selenium storeEval() command.