vc rand in python


Author: Dave
Date: 04.24.17 - 11:17am



rndseed = 0

def vc_srand(x):
    global rndseed
    rndseed = x
    
def vc_rand():
    global rndseed
    rndseed = (rndseed * 214013 + 2531011) & 0xffffffff
    return (rndseed >> 16) & 0x7fff;

vc_srand(0x4b4)

for i in range(0, 25):
    print(hex(vc_rand()))


misc method..
def charShift(s, shift):
    ret=''
    b = bytearray()
    b.extend(s)    
    for index in range(len(b)):
        ret+= chr( ((b[index] + shift) % 256 ))
    return ret
gonna be honest, i hate python...




Comments: (0)

 
Leave Comment:
Name:
Email: (not shown)
Message: (Required)
Math Question: 12 + 11 = ? followed by the letter: U 



About Me
More Blogs
Main Site
Posts: (All)
2020 ( 2 )
2019 ( 5 )
2018 ( 6 )
2017 (6)
     Python and VB6
     Python pros and cons
     download web Dir
     vc rand in python
     VB6 Language Enhancement
     Register .NET as COM
2016 ( 22 )
2015 ( 16 )
2014 ( 25 )
2013 ( 4 )
2012 ( 10 )
2011 ( 7 )
2010 ( 11 )
2009 ( 3 )