PDA

View Full Version : Need to emulate Java style Byte Arrays in php



Mordax
14 Jul 2010, 02:32 PM
So for the past few weeks my life has been one monolithic project in php, this looks like the last hurdle, but its a biggun

I need to emulate UTF8 encoded Java Byte Arrays in php, they need to be conctenated and hashed

I've not been able to get anything that hashes right with php's native variables, I just don't have enough control over how the data is stored or processed

Thus far I've tried using utf8_encode() to see if this produces a php string with a close enough structure, and that didn't work, and I've tried using pack() to see if I can convert the data to a binary array and acheive a closer structure that way, but I don't know enough about the function to make it work

I've used some really funky techniques to get the system to the stage its at, and although I'm not sure how much I'll be allowed to share, I really want to write up on some of them after I'm done

Mordax
02 Oct 2010, 02:08 PM
If anyone thinks they're having the above problem, you're barking up the wrong tree

php variables act exactly like UTF8 Encoded Java Byte Arrays, and the problem is elsewhere in your code

Yes people the above stated project is finally over and I can get back to answering questions, hopefully I'll be able to post some of the write ups I mentioned soon too

The project spanned companies other than my employer, NDAs were involved, so its a matter of picking through and figuring out what of the exotic techniques we used I can and can't talk about, and to what extent