Skip to content

Tag: python-3.x

How to slice hex data?

I have and Hex data in which there are three data present on which I can separate the information contain in the hex data: ID (2 bytes) length of the packet(2 bytes) information from the length of the packet, we come to know how long is the data in this hex data for example hex data = 0001001447364B5F48312E30…

Python Match Case (Switch) Performance

I was expecting the Python match/case to have equal time access to each case, but seems like I was wrong. Any good explanation why? Lets use the following example: And define a quick tool to measure the time: If we run each 10000000 times each case, the times are the following: Just wondering why the access t…