Add files via upload

This commit is contained in:
DJ2LS 2020-12-15 12:06:49 +01:00 committed by GitHub
parent f5026ce1e5
commit 3cf2d4e7af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,16 +69,21 @@ class FreeDV():
###################### CHECKSUM COMPARISON FREEDV VS CRCENGINE ######## ###################### CHECKSUM COMPARISON FREEDV VS CRCENGINE ########
#https://crccalc.com #https://crccalc.com
teststring = b'test' teststring = b'123456789'
#FreeDV crc16 checksum -> c_int16 == c_short
crctest = c_ushort(self.c_lib.freedv_gen_crc16(teststring, 30))
print(crctest.value) #7450
# freedv crc16 checksum
crctest2 = c_ushort(self.c_lib.freedv_gen_crc16(teststring, len(teststring)))
print("FREEDV2: " + str(crctest2.value) + " = " + hex(crctest2.value)) #7450
#Python crc16 checksum #Python crc16 checksum
crc_algorithm = crcengine.new('crc16-ccitt-false') #load crc16 library crc_algorithm = crcengine.new('crc16-ccitt-false') #load crc16 library
crctest2 = crc_algorithm(teststring) crctest3 = crc_algorithm(teststring)
print(crctest2) #8134 print("CRCENGINE: " + str(crctest3) + " = " + hex(crctest3)) #8134
####################################################################### #######################################################################
@ -128,4 +133,4 @@ class FreeDV():
main() main()