vuniom.blogg.se

Convert mac address from hexadecimal
Convert mac address from hexadecimal












convert mac address from hexadecimal

Then we add the second character, which is also f (15), 240+15=255, or the top of our range. f equals 15, so since we are multiplying the first character by 16, 16x15 equals 240. The easiest way to figure it is to take the first character and multiply that by 16, and then add the second character (which would be 0-15, be cause at 16 it reverts to 0 and the first character would go up by 1). Except instead of just 0 or 1, we're rolling all the way up to f.Ġ0 is 0, and ff is 255, thats our range for a MAC address snippet. I apologize because this is very long and I don't know if it made it easy enough.Ġ-f stand for a range from 1-16 (or actually 0-15), which is where hexadecimal gets its name. (Edit: This decimal number you can convert to binary by dividing it as described in another comment)īut knowing binary numbers 0-15 we can also convert hex directly to bin:įor 3 digits hex it would be for example:Ġ001 0000 0000 (bin, notice adding leading zeros for clarity) but there are no 16 digits, so above 9 they are replaced by letters: from a (10) to f (15). Same works for binary, but you have only 1 and 0 as digits, and base is 2, so positions correspond to powers of 2 - let’s take 1101 and convert it to dec:īy analogy - for hex you will have powers of 16 and 16 digits. Simply you have positions and values, eg for dec - the base of calculations is 10, positions correspond to the powers of 10, while available digits are 0-9 let’s take 2247














Convert mac address from hexadecimal