Questions tagged [hex]

Hexadecimal (also base 16, or hex) is the base-16 positional numeral system, using the 16 symbols 0–9 and A‒F.

Hexadecimal (also base 16, or hex) is a numeral system with a base of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a–f) to represent values ten to fifteen.

Each hexadecimal digit represents four binary digits (bits), and the primary use of hexadecimal notation is a human-friendly representation of binary-coded values in computing and digital electronics. More information may be found here.

Other numeral systems:

9640 questions
3
votes
3 answers

Find HEX patterns and number of occurrences

I'd like to find patterns and sort them by number of occurrences on an HEX file I have. I am not looking for some specific pattern, just to make some statistics of the occurrences happening there and sort…
Cy.
  • 2,125
  • 4
  • 26
  • 35
3
votes
1 answer

Reading only x number of bytes from file in VB.NET

I use this code to read full hex of file : Dim bytes As Byte() = IO.File.ReadAllBytes(OpenFileDialog1.FileName) Dim hex As String() = Array.ConvertAll(bytes, Function(b) b.ToString("X2")) Can i only read like first X number of bytes and convert it…
Jedi
  • 153
  • 1
  • 3
  • 8
3
votes
5 answers

How can I convert a string into hex in Java

I'm trying to convert string into hex and decided to use DatatypeConverter.parseHexBinary, it worked in most of cases, but there are some exceptions, like 8f, it's converted into x'3f', instead of x'8f', so I wrote simple test, it turned out to be,…
user2804671
  • 31
  • 1
  • 1
  • 3
3
votes
2 answers

vb.net hex scan from xml file

I was experimenting with some hex scanner sources. Following code works but is very slow: Public Class frmMain Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadFile.Click Dim ArrayHold()…
Jedi
  • 153
  • 1
  • 3
  • 8
3
votes
2 answers

How to convert string to hexadecimal integer in Python?

hi I get user argv from command line as follows: '0x000aff00' and I want python to treat it as hex directly... str = sys.argv[1] how is it possible? thanks!
bbb
  • 267
  • 1
  • 3
  • 6
3
votes
2 answers

Enum types in hex are returning wrong values using Java?

I am using the following enum types in the code below: public static enum PanelType { PAS8((byte)0xA6), PAS83((byte)0xA7);  private byte code;  private PanelType(byte code)  {   this.code=code;  }  public byte getCode(){   return…
Datenshi
  • 1,191
  • 5
  • 18
  • 56
3
votes
2 answers

Extract hexadecimal number from string

I want to extract hexadecimal number from a string. For example, the string is: OxDB52 Message 1 of orderid 1504505254 for number +447123456789 rejected by Operator. I want to extract hexadecimal OxDB52 part. I know it can be done checking for 0x in…
user
  • 5,335
  • 7
  • 47
  • 63
3
votes
3 answers

How to map an integer value to a string in a list?

I'd like to do the following using Python: I have a list of several 'hex code color' strings gradated from green to red. colorGradient = ['#00a500', '#1ea500', '#3ca500', '#5ab400', '#78b400', '#96c300', '#b4d200', '#d2d200',…
3
votes
2 answers

Binary Char to Hex Conversion in C

I am looking at a simple C function created by Tibor Kiss (link below). I am trying to understand how converting a single binary byte to two hex characters involves the addition of 'W' (0x57). Why is this being done? I understand that >> shifts…
JJBladester
  • 51
  • 1
  • 2
  • 9
3
votes
1 answer

Increase / Decrease Mac Address in Python from String

I have a mac address in string form. I am interested in taking the Mac string and increasing / decreasing it by 1 value while keeping the integrity of Hex in Python Ex: 000000001F -1: 000000001E +1: 0000000020
Rob
  • 111
  • 2
  • 5
3
votes
1 answer

Generating a unique ID for every request in a distributed system

I'm trying to generate a unique id for each request in a DS. I'm thinking of concatenating a random integer and timestamp of the request's receipt. Since, getting a random integer can result in negative values I decided to print hex representation: …
user1071840
  • 3,522
  • 9
  • 48
  • 74
3
votes
1 answer

How to create a binary executable using hex?

I have been working with assembly level programming lately and I am able to convert the assembly level code to the machine level code using nasm or as and extract the hex code from it, But how is the inverse possible ? I need to write binary…
vikkyhacks
  • 3,190
  • 9
  • 32
  • 47
3
votes
2 answers

How to test a byte against a hex value?

I want to test if the byte I read from a data file is 0xEE, what should I do? I tried if (aChar == 0xEE) but doesn't seems working.
derrdji
  • 12,661
  • 21
  • 68
  • 78
3
votes
2 answers

how to convert RGB to HEXADECIMAL color in android?

How to convert ARGB(255 0 255 0) color to HEXADECIMAL color. I have ARGB color in database and I retrieve using webservices in JSON format.I want to put color in the text field TAG_DIFF_P (R.id.l7) here it my code, how to add color in background…
ibu
  • 577
  • 4
  • 9
  • 24
3
votes
2 answers

How to burn .hex intel format file on cc2530 EB

Hello there I am a newbie working on the SMARTRF-05EB - Evaluation Board, I have installed SDCC and Contiki-2.6 in the Linux Virtual Machine. I am able to build all the examples present in this directory contiki-2.6/contiki/examples/cc2530dk , but…
linuxstack
  • 757
  • 8
  • 19
1 2 3
99
100