I'm only using this for personal use, just to calculate things..
but I need some help.. I use VisualStudio 2005
first, i used VB
Private Function PRNG(ByVal seed As String) As String
Dim temp As String = ""
Dim t As UInt64
t = Convert.ToUInt64("0x41C64E6D", 16) * Convert.ToUInt64(seed, 16) + Convert.ToUInt64("0x6073", 16)
temp = Hex(t)
If temp.Length < 16 Then
For t = 0 To 15 - temp.Length Step 1 'just to add zero
temp = "0" & temp
Next
End If
PRNG = temp
End Function
then for some reason i have to convert it to C#, here is the code:
using Microsoft.VisualBasic; //for Conversion
private const UInt64 factor = 0x41C64E6D;
private const UInt64 adder = 0x6073;
//...
private string generate(String seed) {
return temp = Conversion.Hex( (factor * Convert.ToUInt64(seed, 16) + adder));
}
but i get different result, well the LSB is the same, but the MSB is different.. any clue? :bidoof::bidoof::bidoof:
thx a lot