gilmer Posted June 15, 2022 Report Share Posted June 15, 2022 Bom Dia, Segue abaixo arrumado #pragma BEGINDUMP #include <Windows.h> #include <hbapi.h> #ifndef DEF_LIBCRC_CHECKSUM_H #define DEF_LIBCRC_CHECKSUM_H #define CRC_POLY_CCITT 0x1021 #define CRC_START_CCITT_FFFF 0xFFFF uint16_t crc_ccitt_ffff( const unsigned char *input_str, size_t num_bytes ); #endif // DEF_LIBCRC_CHECKSUM_H static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value ); static void init_crcccitt_tab( void ); static BOOL crc_tabccitt_init = FALSE; static uint16_t crc_tabccitt[256]; static BOOL crc_tab_init = FALSE; static uint16_t crc_tab[256]; /* * uint16_t crc_ccitt_ffff( const unsigned char *input_str, size_t num_bytes ); * * The function crc_ccitt_ffff() performs a one-pass calculation of the CCITT * CRC for a byte string that has been passed as a parameter. The initial value * 0xffff is used for the CRC. */ uint16_t crc_ccitt_ffff( const unsigned char *input_str, size_t num_bytes ) { return crc_ccitt_generic( input_str, num_bytes, CRC_START_CCITT_FFFF ); } /* crc_ccitt_ffff */ /* * static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value ); * * The function crc_ccitt_generic() is a generic implementation of the CCITT * algorithm for a one-pass calculation of the CRC for a byte string. The * function accepts an initial start value for the crc. */ static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value ) { uint16_t crc; uint16_t tmp; uint16_t short_c; const unsigned char *ptr; size_t a; if ( ! crc_tabccitt_init ) init_crcccitt_tab(); crc = start_value; ptr = input_str; if ( ptr != NULL ) for (a=0; a<num_bytes; a++) { short_c = 0x00ff & (unsigned short) *ptr; tmp = (crc >> 8) ^ short_c; crc = (crc << 8) ^ crc_tabccitt[tmp]; ptr++; } return crc; } /* crc_ccitt_generic */ /* * static void init_crcccitt_tab( void ); * * For optimal performance, the routine to calculate the CRC-CCITT uses a * lookup table with pre-compiled values that can be directly applied in the * XOR action. This table is created at the first call of the function by the * init_crcccitt_tab() routine. */ static void init_crcccitt_tab( void ) { uint16_t i; uint16_t j; uint16_t crc; uint16_t c; for (i=0; i<256; i++) { crc = 0; c = i << 8; for (j=0; j<8; j++) { if ( (crc ^ c) & 0x8000 ) crc = ( crc << 1 ) ^ CRC_POLY_CCITT; else crc = crc << 1; c = c << 1; } crc_tabccitt = crc; } crc_tabccitt_init = TRUE; } // ======================================================================== HB_FUNC( C_EMTCRC_CCITT_FFFF ) // cText --> nTextCRC { hb_retnl( crc_ccitt_ffff( ( unsigned char * ) hb_parc( 1 ), hb_parclen( 1 ) ) ); } #pragma ENDDUMP vailtom 1 Quote Link to comment Share on other sites More sharing options...
JUDSON ROSA Posted June 15, 2022 Report Share Posted June 15, 2022 boa tarde , agora deu esse erro : Executando: harbour.exe "C:\Guardiao_nfce\lib_pix.prg" /q /o"C:\Guardiao_nfce\lib_pix.c" /M /N xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406) Copyright 1999-2009, http://www.xharbour.org http://www.harbour-project.org/ Executando: BCC32 -M -c @B32.BC Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland lib_pix.c: Error E2141 C:\\Guardiao_nfce\\lib_pix.prg 18: Declaration syntax error aponta para essa linha - uint16_t crc_ccitt_ffff( const unsigned char *input_str, size_t num_bytes ); Error E2141 C:\\Guardiao_nfce\\lib_pix.prg 23: Declaration syntax error aponta para essa linha - static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value ); Error E2141 C:\\Guardiao_nfce\\lib_pix.prg 27: Declaration syntax error aponta para essa linha - static uint16_t crc_tabccitt[256]; Error E2141 C:\\Guardiao_nfce\\lib_pix.prg 30: Declaration syntax error aponta para essa linha - static uint16_t crc_tab[256]; Error E2141 C:\\Guardiao_nfce\\lib_pix.prg 40: Declaration syntax error aponta para essa linha - uint16_t crc_ccitt_ffff( const unsigned char *input_str, size_t num_bytes ) { *** 5 errors in Compile *** Quote Link to comment Share on other sites More sharing options...
PJINFO Posted October 26, 2022 Report Share Posted October 26, 2022 Depois de quebrar a cabeça Uma pequena contribuição FUNCAO PARA GERAR O CRC /*************************************/ * Criado em 26/10/2022 - Paulo R.S.JR. * PJ Informática Func GERA_CRC(ctxt) local i,n,a:={} local polinomio:=0x1021 local resultado:=0xFFFF for i=1 to len(ctxt) resultado := nXor(hb_bitShift(asc(substr(ctxt,i,1)),8),resultado) for n=1 to 8 resultado := hb_bitShift(resultado,1) if nand(resultado, 0x10000)<>0 resultado:=nXor(resultado,polinomio) end resultado:=nAnd(resultado,0xFFFF) next next return(DecToHex(resultado)) Quote Link to comment Share on other sites More sharing options...
Ladinilson Posted October 27, 2022 Report Share Posted October 27, 2022 13 horas atrás, PJINFO disse: Depois de quebrar a cabeça Uma pequena contribuição FUNCAO PARA GERAR O CRC /*************************************/ * Criado em 26/10/2022 - Paulo R.S.JR. * PJ Informática Func GERA_CRC(ctxt) local i,n,a:={} local polinomio:=0x1021 local resultado:=0xFFFF for i=1 to len(ctxt) resultado := nXor(hb_bitShift(asc(substr(ctxt,i,1)),8),resultado) for n=1 to 8 resultado := hb_bitShift(resultado,1) if nand(resultado, 0x10000)<>0 resultado:=nXor(resultado,polinomio) end resultado:=nAnd(resultado,0xFFFF) next next return(DecToHex(resultado)) Como seria o cTxt por exemplo? Quote Link to comment Share on other sites More sharing options...
PJINFO Posted October 28, 2022 Report Share Posted October 28, 2022 23 horas atrás, Ladinilson disse: Como seria o cTxt por exemplo? Olá O cTxt é a variável que contem o texto que você quer gerar o CRC, no caso do PIX a chave inteira até o 6304. Ele devolve o asc do CRC do contexto. Quote Link to comment Share on other sites More sharing options...
PJINFO Posted October 28, 2022 Report Share Posted October 28, 2022 Em 27/10/2022 at 08:24, Ladinilson disse: Como seria o cTxt por exemplo? Depois responda se deu certo. Quote Link to comment Share on other sites More sharing options...
aferra Posted January 11, 2023 Report Share Posted January 11, 2023 Verifpro.net - paypal, ebay, stripe, banks, crypto, docs and more! Follow channel https://t.me/Verifpro_accounts to get more info Quote Link to comment Share on other sites More sharing options...
SISCO Posted February 16, 2023 Report Share Posted February 16, 2023 Bom dia a todos Onde encontro CODBAR.CH ? Estou com a versão 16.2 do fivewin. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 16, 2023 Report Share Posted February 16, 2023 49 minutos atrás, SISCO disse: Bom dia a todos Onde encontro CODBAR.CH ? Estou com a versão 16.2 do fivewin. Você não quis dizer: CODEBAR.CH? "Codebar.ch" https://forums.fivetechsupport.com/viewtopic.php?f=6&t=41301&p=247413&hilit=codebar&sid=e0cd0ca1daf40c7b122a3485f56bdb0e#p247413 Regards, saludos. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 16, 2023 Report Share Posted February 16, 2023 Ou você se refere a BARLIB? https://forums.fivetechsupport.com/viewtopic.php?f=3&t=35797&p=220033&hilit=barlib&sid=e0cd0ca1daf40c7b122a3485f56bdb0e#p220033 Regards, saludos. Quote Link to comment Share on other sites More sharing options...
SISCO Posted February 16, 2023 Report Share Posted February 16, 2023 Valeu Kapi Esses links tem um vasto material de QRCode. Fiz uns testes e gerou normalmente, mas não ficou como eu queria. Utilizo o XDevStudio 0.70 e ele está reclamando do codebar.ch e não estou conseguindo encontrar ele. Se poder me ajudar ficarei grato. Quote Link to comment Share on other sites More sharing options...
Theotokos Posted February 16, 2023 Author Report Share Posted February 16, 2023 que tenho é esse BARCODE.CH, vê se isso.... BARCODE.CH Quote Link to comment Share on other sites More sharing options...
SISCO Posted February 16, 2023 Report Share Posted February 16, 2023 Application =========== Path and name: C:\Sistemas\MySISCCO\MySISCCO.EXE (32 bits) Size: 8,709,120 bytes Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20190307) FiveWin version: FWH 19.05 C compiler version: Borland/Embarcadero C++ 7.4 (32-bit) Windows version: 6.2, Build 9200 Time from start: 0 hours 0 mins 9 secs Error occurred at: 16/02/2023, 15:07:21 Error description: Error BASE/1003 Vari vel nÆo existe: DEFAULT_CODEBAR Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 16, 2023 Report Share Posted February 16, 2023 Eu acho que falta a HBZEBRA.LIB https://mega.nz/file/RIlSAB6J#L4qDeL8lY6fmAh0B0oMZ5wQZ5dR9BgpZ9zhezinPT2w Regards, saludos. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 16, 2023 Report Share Posted February 16, 2023 Olhe isto, look this: https://forums.fivetechsupport.com/~fivetec1/forums/viewtopic.php?f=6&t=40111&p=239345&hilit=DEFAULT_CODEBAR&sid=d0f229e33c9e6ce74621355bd30e8cf3#p239345 as novas versões da fazem tudo. Regards, saludos. Quote Link to comment Share on other sites More sharing options...
SISCO Posted February 16, 2023 Report Share Posted February 16, 2023 já está importando HBZEBRA.LIB eu acho que está faltando CODEBAR.CH Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 16, 2023 Report Share Posted February 16, 2023 Homi de Jesus, basta copiar os .CH para C:\FWH..\Inlcude Pasta de C:\HARUPDF 16/02/2023 15:57 <DIR> . 16/02/2023 15:57 <DIR> .. 20/05/2008 23:06 44.059 harupdf.ch 07/01/2021 10:10 349.185 HARUPDF.rar 10/10/2012 17:53 35.840 hbhpdf.lib 09/05/2012 17:10 4.187 hbzebra.ch 10/10/2012 17:53 53.248 hbzebra.lib 16/03/2015 10:35 225 LIB.TXT 18/05/2011 17:42 692.736 libharu.lib 10/10/2012 17:52 153.088 png.lib 14/12/2020 10:53 145 RAR.BAK 07/01/2021 10:10 144 RAR.BAT 16/02/2023 15:57 0 ss.txt 16/03/2015 10:37 521 TESTE.TXT Regards, saludos. Quote Link to comment Share on other sites More sharing options...
SISCO Posted February 16, 2023 Report Share Posted February 16, 2023 Consegui pela DLL Function Generar_QR(cStr AS STRING ,cFile AS STRING ) AS LONG PASCAL FROM "FastQRCode" LIB ".\QRCodelib.dll" Funcionou normal. Obrigado a todos Quote Link to comment Share on other sites More sharing options...
agp.ds Posted February 22, 2023 Report Share Posted February 22, 2023 Boa tarde, andei dando uma olhada nas dicas postadas aqui no fórum e consegui gerar o QRCODE PIX Só não testei com chave email. Segue para quem quiser baixar e modificar https://mega.nz/file/hkUXkKAI#6e4rNTcr-bA9lYvRThy8clH7_N7NWC9imvmkVWBS7y4 Theotokos 1 Quote Link to comment Share on other sites More sharing options...
mkyx Posted February 24, 2023 Report Share Posted February 24, 2023 testei com o app do BB e deu parametros invalidos Quote Link to comment Share on other sites More sharing options...
mkyx Posted February 24, 2023 Report Share Posted February 24, 2023 ACHEI O ARQUIVO, FAVOR IGNORAR, ESSA REQUISIÇÃO Mas, mesmo com o arquivo CODEBAR.CH, continua dando erro de leitura, pelo App do BB. Olá, AGP.DS, fui compilar a sua versão, mas, não tenho o arquivo CODEBAR.CH Onde posso baixá-lo? Quote Link to comment Share on other sites More sharing options...
agp.ds Posted February 27, 2023 Report Share Posted February 27, 2023 Em 24/02/2023 at 15:13, mkyx disse: ACHEI O ARQUIVO, FAVOR IGNORAR, ESSA REQUISIÇÃO Mas, mesmo com o arquivo CODEBAR.CH, continua dando erro de leitura, pelo App do BB. Olá, AGP.DS, fui compilar a sua versão, mas, não tenho o arquivo CODEBAR.CH Onde posso baixá-lo? Olá mkyx, Testei com vários apps tanto do banco do brasil bradesco e caixa e funcionou, segue anexo o CODEBAR.CH Codebar.rar Quote Link to comment Share on other sites More sharing options...
devairlp Posted February 28, 2023 Report Share Posted February 28, 2023 testei com o bco santander, e sempre da erro, não funciona. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.