Questions tagged [hexadecimal]

This tag is for challenges related to hexadecimal, or base 16, a number system that often uses the digits 0 ‐ 9 and a ‐ f. Only use this tag on challenges specific to base 16, rather than generic [base-conversion] challenges

Filter by
Sorted by
Tagged with
8 votes
33 answers
2k views

Hexadecimal -> Binary Art

Take a list of 2-digit hexadecimal numbers as input, and output the binary value, replacing each 1 with an 'X', and each 0 with a space. For example Input = ...
0 votes
0 answers
73 views

Invert colors given a hex color code [duplicate]

So the challenge is, given a string containing a hex color code, write a function in any programming language that takes the string and inverts the color, e.g., ...
18 votes
31 answers
2k views

Reverse hex cipher

Characters in strings are sometimes represented as their ASCII hexadecimal codes. Printable characters have two hex digits in their representation. Swapping those digits leads to another character, ...
  • 12.3k
6 votes
3 answers
225 views

Write a regex that would increment a 2-digit hexadecimal number

Your regex will receive a string of the form !XX! #<extra> where X is any hexadecimal digit (0-9 and A-F capital letters ...
  • 71
11 votes
8 answers
1k views

Scientific notation in Base-16

Input a scientific notation number (base 10), output scientific notation in base 16 (as defined below). Details In scientific notation, all non-zero numbers are written in the form $$ m \times 10^n $$ ...
  • 30.8k
21 votes
19 answers
5k views

Code Golf Measurer © 2019

Code Golf Measurer © 2019 Hexdumps used with xxd look something like this: ...
24 votes
23 answers
4k views

Find the closest three-digit hex colour

In CSS, colours can be specified by a "hex triplet" - a three byte (six digit) hexadecimal number where each byte represents the red, green, or blue components of the colour. For instance, ...
  • 800
-1 votes
11 answers
454 views

Convert alphanumeric (base-36) sentences into hexadecimal (base-16) sentences

I use "sentence" here loosely to mean "any sequence of words separated by spaces" and "words" to mean "sequences of alphanumeric (hexatrigesimal) characters unseparated by spaces". Conversion is from ...
  • 642
0 votes
1 answer
317 views

Python code to produce C++14 hex integer literal with ticks

tl;dr? See bottom for The Competition Integer literals While programming, the 64-bit hexadecimal literal 0x123456789abcdefL is difficult to gauge the size of. I ...
2 votes
5 answers
2k views

0xDEADBEEF is not tasty, but still 0xFEEDBEEF

Inspired by "You had me at hello" Introduction For those who don't know, hexadecimal is a base system like decimal. Contrary to decimal however, it uses 16 (hence the name) digits instead of ...
  • 907
52 votes
30 answers
6k views

Let's golf a BIBABOBU decoder

While I was traveling in the future, I noticed a funny game among kids circa 2275. When they don't want their great-great-great-great-grand parents to understand what they're saying, they use the ...
  • 171k
1 vote
0 answers
173 views

Render a monospaced bitmap font from image [closed]

Input is in this format: image fontwidth fontheight rowwidth xoffset yoffset xgap ygap non-existent charstart thetextitself thetextitself: The text that should ...
21 votes
33 answers
4k views

Swap the Endianness

As most of you probably know, (byte-addressable) hardware memories can be divided into two categories - little-endian and big-endian. In little-endian memories the bytes are numbered starting with 0 ...
  • 16.5k
1 vote
28 answers
2k views

Binary to Hexadecimal

Convert a binary number (of any size) into a hexadecimal number. Input A POSITIVE binary number with just the 0s and 1s. A ...
13 votes
21 answers
2k views

How to convert HEX2 to RGBA?

The world of art is full of colour, but the world of the network is even fuller than the world of art of diferent colours and it's renderings. That's why we need to know how to convert one type of ...
  • 165
46 votes
25 answers
5k views

Better Hex Color Codes for Your Internet

Hex triplets such as #ffffff (white) or #3764ef (blueish) are often used to denote RGB colors. They consist of ...
21 votes
7 answers
819 views

Rotate a camera; save an Astronaut

Note: Minor spoilers for The Martian are in this challenge. Read ahead with caution The Martian is a Science Fiction novel about astronaut and botanist extraordinaire, Mark Watney, who has been ...
  • 57.4k
29 votes
24 answers
3k views

Converting "0xUsernames"

0xUsernames There's so many people using a messaging service that they're running out of space to store all the usernames! To fix this, they are going to start storing usernames as hexadecimal, where ...
  • 14k
46 votes
60 answers
3k views

Print the f × f times table

Your task is to print the hexidecimal times table: ...
30 votes
15 answers
1k views

Output the HTML colors

The 16-color CGA palette (also known as the HTML colors) is a set of 16 colors used by early graphics adapters. The goal of this challenge is to output all 16 of them, in hex format (...
's user avatar
24 votes
25 answers
2k views

Magic popcount numbers

There’s a famous tricky algorithm for counting the number of set bits in a 32-bit unsigned integer: ...
  • 66.2k
4 votes
1 answer
1k views

Reverse an xxd hexdump [duplicate]

Given an xxd hexdump such as this one: ...
  • 6,236
14 votes
8 answers
671 views

The 3x3 Hexa Prime Square Puzzle

The 3x3 Hexa Prime Square Puzzle Introduction We consider 3x3 squares of hexadecimal digits (from 0 to F) such as: ...
  • 171k
17 votes
12 answers
1k views

The Woz Monitor

Challenge I've recently gotten into 8-bit computers and are fascinated with the workings of them and others alike; thus the objective of this code golf, is to replicate a portion of the Woz Monitor, ...
's user avatar
28 votes
24 answers
2k views

Convert to Bibi-binary

Bibi-binary is a numeric system invented by Boby Lapointe in order to represent numbers in letters which pronunciation seems funny. Your task is to convert decimal numbers into Bibi-binary! ...
  • 3,722
15 votes
11 answers
4k views

Convert xxd output to shellcode

Taking some output from xxd and turning it into usable shellcode by hand is no fun, so your job is to automate the process. Rules Your submission can be a function, lambda, script, or any reasonable ...
  • 1,063
23 votes
8 answers
2k views

"Add one" to every color in an image

You would simply take this image and make every color added one to every hexadecimal digit. For example, #49de5f would become ...
-6 votes
9 answers
202 views

Print the input in hexadecimal [duplicate]

Challenges You need to do a program that outputs the input string to hexadecimal! For each character in the input string, convert it's ascii value to hexadecimal and output it out. Example ...
  • 343
23 votes
32 answers
3k views

Convert a number to Hexadecimal

Challenge Here's a simple one. Write a function or program when given a number in base 10 as input, it will return or print that number's value in Hexadecimal. Examples ...
45 votes
23 answers
2k views

Hexadecimal and the Alphabet

In this challenge, you will receive an input, convert it to hexadecimal, make a couple changes, and output the result. Because they are only 16 characters in hexadecimal, your code will need to be as ...
  • 28.5k
41 votes
48 answers
5k views

Numbers that are actually letters

Given a non-negative integer input, write a program that converts the number to hexadecimal and returns a truthy value if the hexadecimal form of the number contains only the characters ...
  • 7,259
-2 votes
1 answer
299 views

Generate a hexdump of a file! [duplicate]

In this task, your goal is to write a program for generating hexdumps of files of arbitrary types. Input The input consists of a (relative or absolute) path to the file to be processed. It may be ...
  • 11.7k
26 votes
3 answers
1k views

Pronouncing Hex

Pronouncing Hex For those of you uninitiated with the show Silicon Valley, this challenge is inspired by an exchange that goes like this (YouTube): ...
  • 7,752
14 votes
39 answers
11k views

Hexadecimal Counter

Hexadecimal is a base 16 counting system that goes from 0 to f. Your job is to make a counter that will display these numbers. ...
  • 2,612
23 votes
2 answers
880 views

Help me procrastinate on my computer repairs!

This challenge is brought to you by real (and tragic) inspiration. Recently, the number row on my keyboard has been a bit sporadic. The keys 1-9 work sometimes--but ...
  • 5,340