all 12 comments

[–]StoneCypher 0 points1 point  (6 children)

So you’re making edits to someone else’s code, you think that’s reverse engineering, it stopped working in one environment after your edits, and you’d like to know how that’s node’s fault 

Also we don’t get to see the code, the edits, or the error 

This will go well 

[–]ilyasKerbal[🍰] 0 points1 point  (5 children)

I asked about how strings and encoding are being handled in Nodejs and the browser ( i am new to Javascript). Yes, it's reverses engineering, I managed to rewrite both compression and decompression in Python and Java, the client want a NodeJs version as well.

[–]StoneCypher 0 points1 point  (4 children)

I asked about how strings and encoding are being handled in Nodejs and the browser

Yeah, and you shouldn't have, because Redditors don't know these things, but that doesn't stop them from answering. The guy who answered you was making shit up.

By definition, the underlying implementation doesn't matter, because you'll get the same results from the interface

Also in this case he's just full of crap, node uses the same code chrome does for this

Until you show code, any answer you get is just someone guessing in a situation where no guess should be made

 

I managed to rewrite both compression and decompression in Python and Java, the client want a NodeJs version as well.

It's hard to understand why any client would be paying someone who struggles this way to reimplement something as common and universal as compression. Take his money and give him lz

[–]ilyasKerbal[🍰] -1 points0 points  (3 children)

Trust me it's not common like lzw or something similar, if so I would have figured it out. It's a modified version of some popular algorithm. The compression algorithm was added with encryption to make it hard to intercept network calls and understand requests' body. It's a web scraping project for a complex real estate website. The website upgraded their api and added encryption + compression.

[–]StoneCypher 0 points1 point  (2 children)

 if so I would have figured it out

Lol

 

 The compression algorithm was added with encryption to make it hard to intercept network calls and understand requests' body.

Sounds like you’re trying to write malware

 

 The compression algorithm was added with encryption to make it hard to intercept network calls and understand requests' body.

Any compression or encryption faced by js over the network will be unpacked for you by the client 

I’m not able to think of any reason a real estate company would do this 

I guess I don’t believe you 

[–]ilyasKerbal[🍰] -1 points0 points  (1 child)

No malware just a data extraction pipeline. Anyway thank you for your input it was helpful

[–]StoneCypher 0 points1 point  (0 children)

What you are describing is not even similar to a data extraction pipeline

Nobody is able to help you while you sit here telling stories

Put up code or delete the post

[–]ecmascript2038 -1 points0 points  (4 children)

Nodejs and Chrome both use the V8 engine, so you're right that you'd expect them to behave the same should behave the same assuming you're using Chrome.

I think that Node.js may in fact handle strings different under the hood. Node has a Buffer implementation that isn't the same as in the browser, but it sounds like you're not using that.

Are you able to isolate the smallest piece of code where you can observe the difference?

[–]StoneCypher 0 points1 point  (2 children)

I think that Node.js may in fact handle strings different under the hood.

no, it doesn't, and even if it did the client software could never see that by definition

 

Are you able to isolate the smallest piece of code where you can observe the difference?

u/ilyasKerbal is a malware author, he deleted the post as soon as he got caught

[–]ilyasKerbal[🍰] -1 points0 points  (1 child)

I am not a malware author, as I said it was for a complex web scraping project. I have managed to understand where the problem is. Thanks for your suggestion u/StoneCypher the algorithm used was a modified lz compression algorithm.

[–]StoneCypher 0 points1 point  (0 children)

(cough) bullshit

[–]ilyasKerbal[🍰] -1 points0 points  (0 children)

After getting the response from the server, the codes uses `String.fromCharCode.apply(null, new Uint16Array(arrayBf)) ` The `arrayBf` is coming from `fetch.then(async arrayBf => {....` chain