[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: [PATCH] KStringHandler::obscure
From:       Szombathelyi György <gyurco () freemail ! hu>
Date:       2003-11-24 20:43:59
[Download RAW message or body]

Monday 24 November 2003 21.09 d=E1tummal Waldo Bastian ezt =EDrta:
> On Mon November 24 2003 20:46, Szombathelyi Gy=F6rgy wrote:
> > Hi!
> >
> > Here's a patch for KStringHandler::obscure(). Current version in CVS
> > doesn't work at all. My version also changes the algorithm somewhat, so
> > identical charaters will be encoded to different chars. I hope it's not=
 a
> > problem, since the function is new in 3.2.
>
> Your version degrades when you get further down the string. After 33
> characters it doesn't do anything anymore.
>
> Cheers,
> Waldo
Actually it doesn't work well after 16 chars. :(
Here's a better version.

Regards,
Gy=F6rgy

____________________________________________________________________
Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
Probald ki most! http://www.freestart.hu

["kstringhandler.diff" (text/x-diff)]

--- kdecore/kstringhandler.cpp.old	2003-11-23 20:34:56.000000000 +0100
+++ kdecore/kstringhandler.cpp	2003-11-24 21:40:34.000000000 +0100
@@ -646,9 +646,7 @@
 {
   QString result;
   for ( uint i = 0; i < str.length(); ++i )
-    result += ( str.unicode()[ i ].unicode() < 0x20 ) ? str.unicode()[ i ] :
-        QChar( 0x1001F - str.unicode()[ i ] );
-
+    result += str[i] ^ ( 0x8765F >> ( i & 0xf ) );
   return result;
 }
 


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic