found, that sometimes it's easyer, to knit it up...
private Sub intFromHex(b1() As Byte)As Int
Dim in As Int
'send( JoinStrings(Array As String("b1 :", bc.StringFromBytes(b1))) ) 'test
For i = 0 To b1.Length - 1
Dim m As Double = Power(16,b1.Length-1-i) ' multiplikator
If b1(i)>60 Then
b1(i) = b1(i) - 55
in = in + b1(i)*m
Else
b1(i) = b1(i) - 48
in = in + b1(i)*m
End If
'send( JoinStrings(Array As String(" i: ", i," m: ", m)) ) 'test
Next
'send( JoinStrings(Array As String("in :", in)) ) 'test
Return in
End Sub
... but be carefull, b1 is to be destructed...
private Sub intFromHex(b1() As Byte)As Int
Dim in As Int
'send( JoinStrings(Array As String("b1 :", bc.StringFromBytes(b1))) ) 'test
For i = 0 To b1.Length - 1
Dim m As Double = Power(16,b1.Length-1-i) ' multiplikator
If b1(i)>60 Then
b1(i) = b1(i) - 55
in = in + b1(i)*m
Else
b1(i) = b1(i) - 48
in = in + b1(i)*m
End If
'send( JoinStrings(Array As String(" i: ", i," m: ", m)) ) 'test
Next
'send( JoinStrings(Array As String("in :", in)) ) 'test
Return in
End Sub
... but be carefull, b1 is to be destructed...
Last edited: