All pastes #88926 Raw Edit

Unnamed

public text v1 · immutable
#88926 ·published 2006-07-15 15:08 UTC
rendered paste body
    def __getuint(this):
        n = this.p[0]
        size = 1
        if this.p[0] & 0x80:
            n = n + (this.p[1] << 7) - 0x80
            if(n & (1<<14)):
                n = n + (this.p[2] << 14) - (1<<14)
                size = 2
            if(n & (1<<21)):
                n = n + (this.p[3] << 21) - (1<<21)
                size = 3
            if(n & (1<<28)):
                n |= 0xF0000000
        return n,size