Or never touching the classic framework
dim mb as new xojo.Core.MutableMemoryBlock( 128 )
for i as integer = 0 to 127
mb.Int8Value(i) = i+30
next
dim hexbytes as new xojo.core.memoryblock( Array( Ctype(48, byte), Ctype(49, byte), Ctype(50, byte), _
Ctype(51, byte), Ctype(52, byte), Ctype(53, byte), _
Ctype(54, byte), Ctype(55, byte), Ctype(57, byte), _
Ctype(57, byte), Ctype(65, byte), Ctype(66, byte), _
Ctype(67, byte), Ctype(68, byte), Ctype(69, byte), _
Ctype(70, byte) ) )
dim mb2 as new xojo.Core.MutableMemoryBlock( mb.Size * 2 )
dim mb2offset as integer
for i as integer = 0 to mb.Size-1
dim upperNibble as int8 = (mb.Int8Value(i) and &hF0) / 16
dim lowerNibble as int8 = (mb.Int8Value(i) and &h0F)
mb2.int8value(mb2offset) = hexbytes.Uint8Value( upperNibble )
mb2offset = mb2offset + 1
mb2.int8value(mb2offset) = hexbytes.Uint8Value( lowerNibble )
mb2offset = mb2offset + 1
next
break