Click here to Skip to main content
15,906,333 members
Home / Discussions / C#
   

C#

 
GeneralRe: string equal Pin
DaveyM694-Jul-08 9:50
professionalDaveyM694-Jul-08 9:50 
AnswerRe: string equal Pin
DaveyM694-Jul-08 9:47
professionalDaveyM694-Jul-08 9:47 
AnswerRe: string equal Pin
N a v a n e e t h4-Jul-08 18:20
N a v a n e e t h4-Jul-08 18:20 
QuestionIssue Setting Remote Registry Key Value Pin
CNewbie4-Jul-08 8:24
CNewbie4-Jul-08 8:24 
QuestionProcess class access denied on smss Pin
stwu4-Jul-08 8:18
stwu4-Jul-08 8:18 
Questiontyped dataset schema relating to xml file Pin
steve_rm4-Jul-08 8:13
steve_rm4-Jul-08 8:13 
QuestionLine in PictureBox Pin
godspeed1234-Jul-08 7:44
godspeed1234-Jul-08 7:44 
AnswerRe: Line in PictureBox Pin
netJP12L4-Jul-08 8:35
netJP12L4-Jul-08 8:35 
AnswerRe: Line in PictureBox Pin
Christian Graus4-Jul-08 9:23
protectorChristian Graus4-Jul-08 9:23 
QuestionSpying on System.Windows.Forms.DataGridView in another app... Pin
Fuzzychaos4-Jul-08 7:28
Fuzzychaos4-Jul-08 7:28 
QuestionC# or C++/CLI? Pin
Tal Rasha's Guardianship4-Jul-08 7:27
Tal Rasha's Guardianship4-Jul-08 7:27 
AnswerRe: C# or C++/CLI? Pin
Paul Conrad4-Jul-08 7:40
professionalPaul Conrad4-Jul-08 7:40 
AnswerRe: C# or C++/CLI? Pin
BadKarma4-Jul-08 12:07
BadKarma4-Jul-08 12:07 
GeneralRe: C# or C++/CLI? Pin
Tal Rasha's Guardianship5-Jul-08 3:47
Tal Rasha's Guardianship5-Jul-08 3:47 
Questionrefresh dataset after updating Pin
jaffa4-Jul-08 6:39
jaffa4-Jul-08 6:39 
AnswerRe: refresh dataset after updating Pin
jaffa4-Jul-08 6:49
jaffa4-Jul-08 6:49 
QuestionString.fromCharCode and charCodeAt Pin
tim_gunning4-Jul-08 6:16
tim_gunning4-Jul-08 6:16 
AnswerRe: String.fromCharCode and charCodeAt Pin
tim_gunning4-Jul-08 6:42
tim_gunning4-Jul-08 6:42 
AnswerRe: String.fromCharCode and charCodeAt Pin
Guffa4-Jul-08 6:43
Guffa4-Jul-08 6:43 
GeneralRe: String.fromCharCode and charCodeAt Pin
tim_gunning4-Jul-08 9:17
tim_gunning4-Jul-08 9:17 
AnswerRe: String.fromCharCode and charCodeAt Pin
Guffa4-Jul-08 12:44
Guffa4-Jul-08 12:44 
GeneralRe: String.fromCharCode and charCodeAt [modified] Pin
tim_gunning4-Jul-08 14:27
tim_gunning4-Jul-08 14:27 
hi
thanks for that, thats very interesting and something I didn't realise.

but... strangely enough that must be the way that javascript handles it (i think *gulp*) as the original way I was doing it :
c#
my_str += (char)(letters[c] ^ keys[cc]);

produces exactly the same result as:
js
my_str += String.fromCharCode((src.charCodeAt(c) ^ keys[cc]));


which was(after to base64 encoding for transport(the unencoded isn't really printable)):
OhFBBxQWEBFLGgsEHgoVRBwSEAYCCw==

and yours produced:
OhhBBh4eCRNPEQkMBQQVVRgaHggBBQ==


I was doing this as an little encryption thing between flash and .net as i couldn't find anything that was compatible, I tried many different ones (rijndael, TEA etc) but all the flash conversions of them produced completely different results from the c# end and I was tearing my hair out trying to do my own conversions of them so I thought i would write a simple (obviously not that strong - but it doesnt need to be super difficult) bit of encryption that i could rewrite in javascript(for the .as files in flash and also for php etc) that would suffice.

but... like you say the larger the string then the larger the problem(or at least load) so now i'm wondering if theres a way to reproduce what you've said in js - this isn't a problem for what I'm doing now but it would be nice to have a better model in place for future.

something for me over the weekend Wink | ;)

thanks for your replies and if you have any thoughts I'd be really interested to hear them.

tim

<edit>
i suppose in js i would just create an array and then use push to add them in and then create the string...but i still don't get why it produces different results from what *should* be the same string...hmmmm time for some script outputting...


modified on Friday, July 4, 2008 8:33 PM

GeneralRe: String.fromCharCode and charCodeAt Pin
Guffa4-Jul-08 14:38
Guffa4-Jul-08 14:38 
GeneralRe: String.fromCharCode and charCodeAt Pin
tim_gunning4-Jul-08 14:49
tim_gunning4-Jul-08 14:49 
GeneralRe: String.fromCharCode and charCodeAt Pin
Guffa5-Jul-08 3:32
Guffa5-Jul-08 3:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.