binary - php - decoding function (bytes and integers) -
i'm beingness asked write decoding function accepts 2 bytes on input, both in range [0x00..0x7f] , recombine them homecoming corresponding integer between [-8192..+8191].
exemplary table comes problem:
hi byte | lo byte | value 40 | 00 | 0 00 | 00 | -8192 7f | 7f | 8191 50 | 00 | 2048 0a | 05 | -6907 55 | 00 | 2688
it's assignment , hate because php isn't optimized interact operating systems much web browsers. it's bits , bytes , binary data, stuff seldom need utilize in php; seems assignment c/c++ or java. anyway, have write in php.
any help appreciated.
php binary byte bits
No comments:
Post a Comment