1
I have the following string:
<Rps><InfDeclaracaoPrestacaoServicoId="1"><Rps><IdentificacaoRps><Numero>4</Numero><Serie>aaa</Serie><Tipo>1</Tipo></IdentificacaoRps><DataEmissao>2019-07-08</DataEmissao><Status>1</Status></Rps><Competencia>2019-07-08</Competencia><Servico><Valores><ValorServicos>2358.77</ValorServicos><ValorDeducoes>0</ValorDeducoes><ValorPis>0</ValorPis><ValorCofins>0</ValorCofins><ValorInss>0</ValorInss><ValorIr>0</ValorIr><ValorCsll>0</ValorCsll><OutrasRetencoes>0</OutrasRetencoes><Aliquota>0</Aliquota><DescontoIncondicionado>0</DescontoIncondicionado><DescontoCondicionado>0</DescontoCondicionado></Valores><IssRetido>1</IssRetido><ResponsavelRetencao>1</ResponsavelRetencao><ItemListaServico>07.02</ItemListaServico><Discriminacao>TESTANDORPSDISCRIMINAO</Discriminacao><CodigoMunicipio>3526902</CodigoMunicipio></Servico><Prestador><CpfCnpj><Cnpj>88888888888888</Cnpj></CpfCnpj><InscricaoMunicipal>123456</InscricaoMunicipal></Prestador><TomadorServico><IdentificacaoTomador><CpfCnpj><Cnpj>55555555555555</Cnpj></CpfCnpj></IdentificacaoTomador><RazaoSocial>Dorotheo</RazaoSocial><Endereco><Endereco>RuaJapo</Endereco><Numero>2</Numero><Complemento>TESTERPS</Complemento><Bairro>Jaragua</Bairro><CodigoMunicipio>3550704</CodigoMunicipio><Uf>SP</Uf><Cep>11600318</Cep></Endereco><Contato><Telefone>12345678901</Telefone><Email>[email protected]</Email></Contato><AtualizaTomador>2</AtualizaTomador><TomadorExterior>2</TomadorExterior></TomadorServico><InformacoesComplementares>TESTANDORPS</InformacoesComplementares></InfDeclaracaoPrestacaoServico></Rps>TLXX4JN38KXTRNSEAJYYEA==
And I must get as Hash:
61AEC2215401D0099D85D70A56D72949860CA07C55620C37B49F8F2DA7CF9A671AFAC6C96D95BD74F9304B97CEBC6A90CDF9F7134B2A5F41A12629F7D6111BA1
(You can check on that website)
I did the following function :
public string HashIntegridade(string Dados)
{
SHA512 shaM = SHA512.Create();
var hashIntegridadeBytes = shaM.ComputeHash(Encoding.UTF8.GetBytes(Dados));
return Encoding.UTF8.GetString(hashIntegridadeBytes);
}
I have tested different variations of this function, trying to use Encoding.ASCII.GetBytes
and other types of encoding and never get the expected result.
The result I’m getting a��!T\u0001�\t���\nV�)I�\f�|Ub\f7���-�Ϛg\u001a���m��t�0K�μj����\u0013K*_A�&)��\u0011\u001b�
.