Click here to Skip to main content
15,896,727 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: String.fromCharCode and charCodeAt Pin
tim_gunning6-Jul-08 2:08
tim_gunning6-Jul-08 2:08 
GeneralRe: String.fromCharCode and charCodeAt Pin
N a v a n e e t h4-Jul-08 16:45
N a v a n e e t h4-Jul-08 16:45 
GeneralRe: String.fromCharCode and charCodeAt Pin
Guffa5-Jul-08 3:18
Guffa5-Jul-08 3:18 
GeneralRe: String.fromCharCode and charCodeAt Pin
N a v a n e e t h5-Jul-08 16:33
N a v a n e e t h5-Jul-08 16:33 
Questionwindows service Pin
arkiboys4-Jul-08 4:55
arkiboys4-Jul-08 4:55 
AnswerRe: windows service Pin
Michael90004-Jul-08 8:17
Michael90004-Jul-08 8:17 
AnswerRe: windows service Pin
N a v a n e e t h4-Jul-08 18:43
N a v a n e e t h4-Jul-08 18:43 
QuestionAccess Denied to AllUsers Folder Pin
Richard Blythe4-Jul-08 4:43
Richard Blythe4-Jul-08 4:43 
AnswerRe: Access Denied to AllUsers Folder Pin
Daniel Grunwald5-Jul-08 7:27
Daniel Grunwald5-Jul-08 7:27 
GeneralRe: Access Denied to AllUsers Folder Pin
Richard Blythe5-Jul-08 16:24
Richard Blythe5-Jul-08 16:24 
QuestionRe:How to find out unused registry keys Pin
RameshwerE4-Jul-08 3:54
RameshwerE4-Jul-08 3:54 
AnswerRe:How to find out unused registry keys Pin
Simon P Stevens4-Jul-08 3:58
Simon P Stevens4-Jul-08 3:58 
AnswerRe:How to find out unused registry keys Pin
Christian Graus4-Jul-08 9:21
protectorChristian Graus4-Jul-08 9:21 
Questionhow to restart application after updating version Pin
asma_panjabi4-Jul-08 1:39
asma_panjabi4-Jul-08 1:39 

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.