ezzetabi Posted November 19, 2004 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
killaz219 Posted November 20, 2004 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
ezzetabi Posted November 20, 2004 Author Posted November 20, 2004 Msgbox(0,'','_Rot112:'& @TAB & _Rot112('My message') & @lf & 'Original:'& @tab & _Rot112( _Rot112('My message')))
ezzetabi Posted November 20, 2004 Author 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
ezzetabi Posted November 20, 2004 Author 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now