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: (1)

On 02.11.21 - 3:17am Dave wrote:
2021..I still hate python! - fragile dependencies always a fight even with pip, dont trust auto downloads, multiple versions of python on my machine, shit might only work in one version. Its like basic but worse, totally regression from vb6 only suitable for quick bullshit scripts that you dont distribute. The world is doomed the way people are (ab)using it.

 
Leave Comment:
Name:
Email: (not shown)
Message: (Required)
Math Question: 5 + 53 = ? followed by the letter: M 



About Me
More Blogs
Main Site
Posts: (All)
2024 ( 3 )
2023 ( 9 )
2022 ( 4 )
2021 ( 2 )
2020 ( 4 )
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 ( 15 )
2014 ( 25 )
2013 ( 4 )
2012 ( 10 )
2011 ( 7 )
2010 ( 11 )
2009 ( 3 )