All pastes #499450 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-21 02:05 UTC
rendered paste body
    Sub prepareChecksum(ByRef checksum As Integer)
        Dim tmp As Integer, tmp1 As Integer, tmp2 As Integer, tmp3 As Integer
        tmp = checksum
        checksum *= 2 ^ 12
        tmp1 = tmp
        tmp1 &= &HF0
        tmp1 *= 2 ^ 4
        checksum = checksum Or tmp1
        tmp2 = tmp
        tmp2 &= &HF00
        tmp2 >>= 4
        checksum = checksum Or tmp2
        tmp3 = tmp
        tmp3 >>= 12
        checksum = checksum Or tmp3
        checksum &= &HFFFF
    End Sub