Seems like a hard way to do it, but this works for me.

============

function decodeQ64 (QBlock As MemoryBlock, firstByte As Integer) As String

Const blockSize = 8

Const stringSize = 16

Dim m As New MemoryBlock(blockSize)

Dim i, hVal As Integer

Dim aVal As Int64

Dim pFactor( stringSize ) As Int64

Dim byteValue As integer

Dim s, h1 As String

for i = stringSize DownTo 1

pFactor( i ) = Pow( stringSize, stringSize - i )

Next

for i = 0 to blockSize - 1

m.Byte(i) = QBlock.Byte( firstByte + i )

Next

for i = 0 to blockSize - 1

byteValue = m.Byte( i )

h1 = hex( byteValue )

if len( h1 ) = 1 Then h1 = "0" + h1

s = s + h1

Next

for i = 1 to stringSize

hVal = asc( mid( s, i, 1 ) )

Select case hVal

Case 48 to 57

hVal = hVal - 48

Case 65 to 70

hVal = ( hVal - 65) + 10

End

aVal = aVal + (hVal * pFactor( i ) )

Next

Return str( aVal )

=============

Is there an easier way to do this???