❔ How i can convert a js function to c#
I have a VERY complex function on js and i want it to parse it to c#
20 Replies
There are no readymade tools for this. You could try throwing it at chatgpt and see if it works, but its very likely to make mistakes.
best bet is to do it by hand
amm
the function is this one
ah. obfuscated?
probably
¯\_(ツ)_/¯
Chat gpt just made it
:0
Does it work thou, are all inputs and respective outputs the same?
nope
also I can already tell its not the same
unescape(encodeURI(y)) + "\u0080"
does not "translate" into Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(y)) + "\u0080";
i think f its just md5 hash
Oh its like a modified md5 hash function
:C
OMG I DID IT
i feel proud of myself and of gpt 🥲
what the fuck is
1E11
oh it's the exponent...
very confusing syntax that
the using
in the GenerateApiKey
method is pointlessyou shouldn't be creating a new instance of
Random
inside the method
it's seeded with system time by default, so if you call it fast enough it will generate duplicates
ah, news to meRetax#0813
REPL Result: Success
Console Output
Compile: 511.179ms | Execution: 43.324ms | React with ❌ to remove this embed.
then what you recomend
read the conversation that followed and you'll have answers
i see thath is fixed but what was you gonna say
that was it
just reuse one instance
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.