Skip to content

How to se threefive to validate the CRC_32 of a SCTE35 message #102

Answered by futzu
fxengelbrecht asked this question in Q&A
Discussion options

You must be logged in to vote

I was worried about false negatives. As I mentioned, threefive re-calculates everything it can when encoding, and also fixes several common errors I've seen over and over. I decided to check the crc32 from the raw bites, much like you thinking with the hex.

a@fu:~$ python3
>>> from threefive import Cue
>>> cue=Cue('/DA3AAAAAAAAAP/wDwUAAAAAf//+AClWCAIrAAAAFwIVQ1VFSQAAAAB/yAAAKTLgAQEwMAAAlDpDfA==')
>>> cue.decode()
True
>>> cue.info_section.crc
'0x943a437c'
>>> from threefive.crc import crc32

>>> hex(crc32(cue.bites[:-4]))
'0x943a437c'
>>> cue.info_section.descriptor_loop_length
23
>>> cue.encode()
'/DA5AAAAAAAAAP/wDwUAAAAAf//+AClWCAIrAAAAGQIXQ1VFSQAAAAB/yAAAKTLgAQEwMAAAAACRUPll'
>>> cue.i…

Replies: 4 comments 13 replies

Comment options

You must be logged in to vote
1 reply
@fxengelbrecht
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@futzu
Comment options

@futzu
Comment options

@fxengelbrecht
Comment options

@futzu
Comment options

@futzu
Comment options

Answer selected by futzu
Comment options

You must be logged in to vote
4 replies
@fxengelbrecht
Comment options

@futzu
Comment options

@futzu
Comment options

@futzu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants