ezzetabi 3 Posted November 19, 2004 (edited) ...when you can have all printable ones? msgbox(0,'', _Rot112( _Rot112('This wont change.'))) Func _Rot112($String) Local $sChars = '', $c, $iSl = StringLen($String), $iPos For $c = 32 To 255 $sChars = $sChars & Chr($c) Next For $c = 32 To 144 $sChars = $sChars & Chr($c) Next For $c = 1 To $iSl $iPos = StringInStr($sChars, StringMid($String, $c, 1), 1) If $iPos <> 0 Then $String = StringLeft($String, $c - 1) & StringMid($sChars, $iPos + 112, 1) & _ StringTrimLeft($String, $c) EndIf Next Return $String EndFunc ;==>_Rot112 Probably it can be made in more efficent way, but I am soo sleepy. Edited November 19, 2004 by ezzetabi Share this post Link to post Share on other sites
killaz219 2 Posted November 20, 2004 (edited) Pretty good, but for an example (like you do in most UDFs) you should just do msgbox(0,'', _Rot112('This is what rot112 looks like')) Edited November 20, 2004 by killaz219 Share this post Link to post Share on other sites
ezzetabi 3 Posted November 20, 2004 Msgbox(0,'','_Rot112:'& @TAB & _Rot112('My message') & @lf & 'Original:'& @tab & _Rot112( _Rot112('My message'))) Share this post Link to post Share on other sites
ezzetabi 3 Posted November 20, 2004 (edited) I'd like to make a small variation, in order to rotate also @lf and @cr, what do you think? (Rot113 ) Edited November 20, 2004 by ezzetabi Share this post Link to post Share on other sites
ezzetabi 3 Posted November 20, 2004 Here we are, now also @cr and @lf chars are rotated, so the text will lose its format when encrypted. MsgBox(0,'',_Rot113(_Rot113('First Line' & @lf & 'Second line')) & @lf & _Rot113('First Line' & @lf & 'Second line')) Func _Rot113($String) Local $sChars = @CRLF, $c, $iSl = StringLen($String), $iPos For $c = 32 To 255 $sChars = $sChars & Chr($c) Next $sChars = $sChars & @CRLF For $c = 32 To 144 $sChars = $sChars & Chr($c) Next For $c = 1 To $iSl $iPos = StringInStr($sChars, StringMid($String, $c, 1), 1) If $iPos <> 0 Then $String = StringLeft($String, $c - 1) & StringMid($sChars, $iPos + 113, 1) & StringTrimLeft($String, $c) EndIf Next Return $String EndFunc ;==>_Rot112 Share this post Link to post Share on other sites