<filename>utilfunctions.py<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#  utilfunctions.py
#  
#  Copyright 2017  <<EMAIL>>
#  

def checksum(data):
	"""
	Calculate and return a checksum for skytraq binary protocol
	XOR
	"""
	checksum = 0
	for by in data:
		checksum ^= ord(by)
	#print (hex(checksum))
	return hex(checksum)

<filename>utilfunctions.py<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#  utilfunctions.py
#  
#  Copyright 2017  <<EMAIL>>
#  

def checksum(data):
	"""
	Calculate and return a checksum for skytraq binary protocol
	XOR
	"""
	checksum = 0
	for by in data:
		checksum ^= ord(by)
	#print (hex(checksum))
	return hex(checksum)

#!/usr/bin/env python # -*- coding: utf-8 -*- # #  utilfunctions.py # #  Copyright 2017  <<EMAIL>> # Calculate and return a checksum for skytraq binary protocol 	XOR #print (hex(checksum))