PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 25 → Pix by Paulo Viana
Pix by Paulo Viana
Iniciado por Boller, dez., 16 2020 7:38 PM - 1 resposta
Membro registado
3.651 mensagems
Popularité : +175 (223 votes)
Publicado em dezembro, 16 2020 - 7:38 PM
sobre a montagem DO CRC No windev

Procedure rot_pix(chave)

meuvalor is string=chave

nTamanho is int = Length(meuvalor)
nPoly is 2-byte unsigned int = 0x1021
Wcrc is 2-byte unsigned int = 0xFFFF
NC is 2-byte unsigned int = 0

FOR i=1 TO Length(meuvalor)
Wcrc = BinaryXOR(Wcrc, Asc(meuvalor[[i]]) bitLeftShift 8)
NC = 0
FOR j = 0 TO 7
IF (Wcrc & 0x8000) THEN
Wcrc=(Wcrc bitLeftShift 1) || 0x1021
ELSE
Wcrc=Wcrc bitLeftShift 1
END
END
END

RESULT(chave+IntToHexa(Wcrc)[[5 TO ]])


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Membro registado
3.651 mensagems
Popularité : +175 (223 votes)
Publicado em dezembro, 16 2020 - 7:40 PM
Maiores informações

https://www.bcb.gov.br/estabilidadefinanceira/pix

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/