#NEWLINE# def ogg_crc32( data ) : #NEWLINE# #INDENT# if ( not CRC_LUT ) : #NEWLINE# #INDENT# for idx in range ( 256 ) : #NEWLINE# #INDENT# r = ( idx << 24 ) #NEWLINE# for i in range ( 8 ) : #NEWLINE# #INDENT# if ( r & 2147483648 ) : #NEWLINE# #INDENT# r = ( ( r << 1 ) ^ 79764919 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# r <<= 1 #NEWLINE# #UNINDENT# #UNINDENT# CRC_LUT . append ( ( r & 4294967295 ) ) #NEWLINE# #UNINDENT# #UNINDENT# reg = 0 #NEWLINE# for i in bytes ( data ) : #NEWLINE# #INDENT# reg = ( ( ( reg << 8 ) ^ CRC_LUT [ ( ( ( reg >> 24 ) & 255 ) ^ i ) ] ) & 4294967295 ) #NEWLINE# #UNINDENT# return reg