byte

Can JavaScript process binary data?

Admit me describe my questions in situation-oriented way: Assume Internet Explorer is still the dominating web browser (Firefox has document for binary processing): The XMLHttpRequest.responseText or XMLHttpRequest.responseXML in Internet Explorer desire txt or xml/xhtml/html, but what about the server response the xmlHttprequest wit...

Is it viable and necessary to encrypt bytes?

We have a requirement from customer that if someone gets access to the database, all data that includes personal information should be encrypted, so that when they do select calls, they shouldn't be able to see anything in clear text. Now this isn't any problem for Strings, but what about bytearrays? (that can potentially be quite huge (...

Inserting bits into byte

I was looking at an example of reading bits from a byte and the implementation looked simple and easy to understand. I was wondering if anyone has a similar example of how to insert bits into a byte or byte array, that is easier to understand and also implement like the example below. Here is the example I found of reading bits from a ...

How to read a file byte by byte in Python and how to print a bytelist as a binary?

Hi, I'm trying to read a file byte by byte, but I'm not sure how to do that. I'm trying to do it like that: file = open(filename, 'rb') while 1: byte = file.read(8) # Do something... So does that make the variable byte to contain 8 next bits at the beginning of every loop? It doesn't matter what those bytes really are. The only...

Merge two bytes in java/android

Hi, I have a frame of 22 bytes. The frame is the input stream from an accelerometer via bluetooth. The acceleromter readings are a 16 bit number split over two bytes. When i try to merge the bytes with buffer[1] + buffer[2], rather than adding the bytes, it just puts the results side by side. so 1+2 = 12. Could someone tell me how to ...

Error at creating a temporary clob from oracle in c#

Hi everyone, I want to create a temporary clob. That's my function: public static OracleLob CreateTemporaryClob(OracleConnection conn, OracleTransaction tx, string data) { OracleLob tempClob = null; byte[] bData = new System.Text.ASCIIEncoding().GetBytes(data); string cmdText = "declare a clob; begin dbms_lob.createtempora...

How many bytes is \n\r?

I have a .net app that is trying to ftp a file and we're ending up with 1 extra byte per line. My Line Separatro is Environment.NewLine which I beleive transaltes into \n\r. How many bytes is that? ...

bit manipulation in java

I have a fragment of bytes in a byte[]. The total size of the array is 4 and I want to convert this into a positive long number. For example if the byte array is having four bytes 101, 110, 10, 10000001 then i want to get the long number represented by binary sequence 00000000 00000000 00000000 00000000 00000101 00000110 00000010 10000...

C++ struct containing unsigned char and int bug

Ok i have a struct in my C++ program that is like this: struct thestruct { unsigned char var1; unsigned char var2; unsigned char var3[2]; unsigned char var4; unsigned char var5[8]; int var6; unsigned char var7[4]; }; When i use this struct, 3 random bytes get added before the "var6", if i delete "var5" it's still before "var6" ...

Byte from string/int in C++

Hi, I'm a beginning user in C++ and I want to know how to do this: How can I 'create' a byte from a string/int. So for example I've: string some_byte = "202"; When I would save that byte to a file, I want that the file is 1 byte instead of 3 bytes. How is that possible? Thanks in advance, Tim ...

Are these two functions the same?

There is a function in the AES algorithm, to multiply a byte by 2 in Galois Field. This is the function given in a website private static byte gfmultby02(byte b) { if (b < 0x80) return (byte)(int)(b <<1); else return (byte)( (int)(b << 1) ^ (int)(0x1b) ); } This is the function i wrote. private st...

What's the cleanest way to do byte-level manipulation?

I have the following C struct from the source code of a server, and many similar: // preprocessing magic: 1-byte alignment typedef struct AUTH_LOGON_CHALLENGE_C { // 4 byte header uint8 cmd; uint8 error; uint16 size; // 30 bytes uint8 gamename[4]; uint8 version1; uint8 version2; ...

How to split byte strings with a space in AutoIt?

I would like to split byte strings, for example "AAFF10DC", with spaces, so it becomes "AA FF 10 DC". How to do this in AutoIt (v3)? ...

How do you access byte level information in JavaScript?

The generally accepted answer is that you can't. However there is mounting evidence that this is not true based on the existence of projects that read in types of data that are not basic HTML types. Some projects that do this are the JavaScript version of ProtoBuf and Smokescreen. Smokescreen is a flash interpreter written in JS so if i...

C# to php translator

Is there a C# to php translator (capable of dealing with byte operations, TCPSockets)? ...

from string of bytes to OpenCV's IplImage in Python?

Hey all, I am streaming some data down from a webcam. When I get all of the bytes for a full image (in a string called byteString) I want to display the image using OpenCV. Done fast enough, this will "stream" video from the webcam to an OpenCV window. Here's what I've done to set up the window: cvNamedWindow('name of window', CV_WIND...

Free memory of a byte array in Java

What is the best way to release memory allocated by an array of bytes (new byte[size] in Java)? ...

Finding value of 2 bytes in Java

I am trying to find the value of the first 2 bytes in a UDP packet which corresponds to the length of the remaining payload. What is the best method to find this value in Java given that I know the first 2 bytes? Would java.nio.ByteBuffer be of any use? Thanks ...

C# Run Program from byte array

Hello, I have a program stored in byte array. Is it possible to run it inside C#? Thanks ...

how to convert hexadecimal to byte in php

I am very new to PHP I mean I want to create a byte array something like this byte array[] = { (byte) 0x9C, (byte) 0xA0}; how to do I do it in PHP any syntactical help highly apreciated. I mean how to create a byte array in php. Thanks in advance ...