For those of you new to strings and their ascii values, there's a very quick way to access their ascii value without using mid$ and the asc() function.
You can also build an ascii byte array to transform it back into string.
A simple, and very fast, encryption routine:
VB Code:
Dim BytAry() as Byte Dim mStr as String Dim x as Long mStr = "any string" 'convert VB's BSTR(unicode) to single ASCii values BytAry = StrConv(mStr,vbFromUnicode) 'dim encryption array ReDim EncAry(ubound(BytAry)) as Byte 'loop For x = 0 to ubound(BytAry) 'Xor values for a simple encryption EncAry(x) = BytAry(x) Xor 255 Next 'Convert ascii array to unicode array so VB can directly use a unicode byte array as a string MsgBox StrConv(EncAry,vbUnicode)
Using this method several MBs can be processed instantly(when compiled).
On my machine, Xp 1600+, 256 MB DDR, it does 35 MB/s.
Processes 1 GB in barely over 29 seconds.




Reply With Quote