Skip to main content

Questions tagged [encoding]

This challenge relates to data expressed under a different representation or language (including encoding, decoding, and processing such data). Some examples of an encoding includes ASCII and UTF-8.

Filter by
Sorted by
Tagged with
5 votes
14 answers
1k views

Mulenère cipher is a version of Vigenère ciphers, which uses multiplication instead of addition. Algorithm It's simple. First, the password will repeated as much as reach a size bigger than length of ...
QOO-OOKALAN's user avatar
3 votes
7 answers
597 views

To save codepoints, a compute-er can share 0 and -, and share . with ...
l4m2's user avatar
  • 32.7k
-1 votes
1 answer
132 views

Input: a string in a representation supported by your language Task: Output the string's representation in base64. code-golf, so fewest bytes in each language wins! Here's a example base64 encoder in ...
Quirky-Quasar's user avatar
16 votes
21 answers
2k views

ZigZag encoding is a method of encoding signed integers to unsigned integers. Non-negative integers are multiplied by two. Negative integers are equal to their absolute values multiplied by two, minus ...
Jordan's user avatar
  • 12k
6 votes
11 answers
1k views

Write a codec that encodes list of bytes by calculating the difference between the values (0-255) of consecutive bytes, converting those differences to their hexadecimal representation, and ...
mastaH's user avatar
  • 465
12 votes
12 answers
1k views

Similar question to my previous one, but in reverse. This time I want you to encode an integer into a VarInt. Background: I'm not going to assume everyone's seen my previous question, so here is a ...
ThePlaneGuy45's user avatar
-1 votes
1 answer
98 views

Assignment: Create a function that can convert a string to its encoded hexadecimal value. In your answer, also show how to run this function (to validate answers). Your function must return OR print ...
Jake's user avatar
  • 314
13 votes
27 answers
1k views

Task is simple! Take an array of binary values (can be boolean, 0/1, etc.) and use those bits to construct an n-th bit long unsigned integer (return type does not need to be an unsigned integer, just ...
ThePlaneGuy45's user avatar
2 votes
0 answers
222 views

Given a string of ASCII text as input, encode it in BPSK31 using Varicode. You may either output an audio file in any common format, or play the audio over the device speakers. You may output at any ...
Someone's user avatar
  • 1,252
12 votes
16 answers
3k views

Problem You are tasked with creating a program that performs emoji encryption on a given string of emojis. In this encryption scheme, each emoji is replaced by a unique character (from ...
3.14's user avatar
  • 403
10 votes
3 answers
399 views

Suppose we want to encode a large integer \$x\$ as a list of words in such a way that the decoder can recover \$x\$ regardless of the order in which the words are received. Using lists of length \$k\$ ...
Karl's user avatar
  • 871
14 votes
7 answers
2k views

Part I Previous part was considered encoding of non-empty nested lists with a positive integer. Reminding the coding procedure \$G(x)\$: If \$x\$ is a number, \$G(x) = 2^x\$ If \$x\$ is a list \$[n_0,...
lesobrod's user avatar
  • 3,448
31 votes
18 answers
3k views

Related but different. Part II Taken from the book: Marvin Minsky 1967 – Computation: Finite and Infinite Machines, chapter 14. Background As the Gödel proved, it is possible to encode with a unique ...
lesobrod's user avatar
  • 3,448
13 votes
25 answers
2k views

The task is simple. You're given an arbitrary string message. Return that message prefixed with a number, such that the length of that number plus the message equals the number. In other words, the ...
virchau13's user avatar
  • 499
6 votes
4 answers
385 views

Description Inspired by this question, write a program/function to encode a number and a program (possibly the same as the first) to decode a bitstream in variable-length encoding as follows (taken ...
justhalf's user avatar
  • 2,279
19 votes
9 answers
2k views

In the hovertext of this xkcd: There's an "encoding" based on replacing runs of roman numerals with their sums. To do this: Find all runs of at least 1 roman numeral (...
emanresu A's user avatar
  • 46.2k
14 votes
12 answers
2k views

Background Zeckendorf representation is a numeral system where each digit has the value of Fibonacci numbers (1, 2, 3, 5, 8, 13, ...) and no two consecutive digits can be 1. Nega-Zeckendorf ...
Bubbler's user avatar
  • 79.3k
10 votes
8 answers
944 views

The Len(language,encoding) family of languages is a variety of Lenguage derivatives. To encode a program into a Len language, you replace every character with its representation in a certain encoding, ...
emanresu A's user avatar
  • 46.2k
18 votes
14 answers
2k views

Inspired by this video by Ben Eater. This challenge forms a pair with Decode USB packets. The USB 2.0 protocol uses, at a low level, a line code called non-return-to-zero encoding (specifically, a ...
pxeger's user avatar
  • 25.3k
32 votes
19 answers
3k views

Inspired by this video by Ben Eater. This challenge forms a pair with Encode USB packets. The USB 2.0 protocol uses, at a low level, a line code called non-return-to-zero encoding (specifically, a ...
pxeger's user avatar
  • 25.3k
6 votes
0 answers
305 views

The goal is simple. Write a program that outputs itself encoded as a QR code. A QR code is a way to encode data in a black and white image, similar to a 2D image. An example implementation can be ...
Ari's user avatar
  • 201
17 votes
14 answers
1k views

Swap encoding is an encoding method where you iterate through a string, reversing sections of it between pairs of identical characters. The basic algorithm For each character in the string: Check: ...
emanresu A's user avatar
  • 46.2k
25 votes
27 answers
2k views

The code has a lot of names, but is very simple: 1 2 3 4 5 1 A B C D E 2 F G H I J 3 L M N O P 4 Q R S T U 5 V W X Y Z A letter is coded by its coordinates, ...
Samuel Waller's user avatar
10 votes
11 answers
1k views

Related: Elias omega coding: encoding Background Elias omega coding is a universal code which can encode positive integers of any size into a stream of bits. Given a stream of bits \$S\$, the decoding ...
Bubbler's user avatar
  • 79.3k
24 votes
29 answers
3k views

Background Elias omega coding is a universal code which can encode positive integers of any size into a stream of bits. Given a positive integer \$N\$, the encoding algorithm is as follows: Start ...
Bubbler's user avatar
  • 79.3k
36 votes
12 answers
3k views

A little while back, data was frequently stored on punched card. A typical card would have 80 columns of 12 possible 'punch' positions. A plethora of encodings was used, each for their own specific ...
Sanchises's user avatar
  • 9,536
10 votes
6 answers
514 views

Background In JIS X 0208 a 94 by 94 map (kuten (区点)) is defined to encode Chinese characters (kanji), phonetic moras (kana) and other symbols. Along with this standard there are 3 different encodings ...
Shieru Asakoto's user avatar
1 vote
1 answer
296 views

You get a string which contains an integer between 1000 and 99999999 as input. The input string might contain leading zeroes but ...
arminb's user avatar
  • 783
-2 votes
13 answers
739 views

Challenge I think everyone of us heard of URL encoding mechanism - it's basically everywhere. Given an URLEncoded string on stdin, decode it, and output the decoded form to stdout. The encoding is ...
Kamila Szewczyk's user avatar
8 votes
13 answers
778 views

Background Inspired by a now deleted question by John Burger from which I quote: Now obviously no human made this mistake. It's a mis-decode of something - perhaps the ISBN? My question is: ...
Adám's user avatar
  • 31.8k
17 votes
19 answers
3k views

Introduction: I have loads of different ciphers stored in a document I once compiled as a kid, I picked a few of the ones I thought were best suitable for challenges (not too trivial, and not too ...
Kevin Cruijssen's user avatar
19 votes
13 answers
2k views

Introduction: I have loads of different ciphers stored in a document I once compiled as a kid, I picked a few of the ones I thought were best suitable for challenges (not too trivial, and not too hard)...
Kevin Cruijssen's user avatar
16 votes
14 answers
2k views

Introduction: I have loads of different ciphers stored in a document I once compiled as a kid, I picked a few of the ones I thought were best suitable for challenges (not too trivial, and not too hard)...
Kevin Cruijssen's user avatar
17 votes
19 answers
4k views

You probably all know the 7-segment display which can display among other things all digits from \$0\dots 9\$: Challenge We only consider the segments \$\texttt{A}\dots\texttt{G}\$, your task is to ...
ბიმო's user avatar
23 votes
23 answers
4k views

Challenge Your task is to encode an integer as a string of ASCII characters, then successfully decode it after said string has been randomly shuffled. You will write two programs/functions, which ...
Delfad0r's user avatar
  • 6,276
8 votes
5 answers
986 views

Write a program which can encode text to avoid reusing characters, and convert back. Both normal and encoded forms are restricted to a particular character set: the space character ...
EPICI's user avatar
  • 409
6 votes
1 answer
160 views

We define a tree-like list, or trist for short, as the empty list or a list containing only previously constructed trists. The natural numbers can either include 0 or not, according to your ...
ngn's user avatar
  • 15.6k
25 votes
12 answers
3k views

Given a string, character list, byte stream, sequence… which is both valid UTF-8 and valid Windows-1252 (most languages will probably want to take a normal UTF-8 string), convert it from (that is, ...
Adám's user avatar
  • 31.8k
52 votes
12 answers
9k views

The task is taken from an MIT lecture by Prof. Devadas called You can read minds. A detailed explanation of the trick can be found in the linked video, or in this document. I'll try to explain it in ...
Stewie Griffin's user avatar
16 votes
10 answers
2k views

How the encoding works Given a list of bits: Hold a prime (starting with 2) Have a list For each bit in the input If it's the same as the previous bit, add the ...
Asone Tuhid's user avatar
  • 2,413
8 votes
3 answers
680 views

Inspired by both the challenge "Unique is Cheap" by @Laikoni, where the score is based on the challenge itself, as well as the JavaScript (ES6) answer of @ETHproductions for the "...
Kevin Cruijssen's user avatar
15 votes
11 answers
2k views

Task Encode a string that entirely consists of uppercase alphabets (A-Z) using only zeros and ones, using your own favorite scheme. But the rule isn't that simple! ...
Bubbler's user avatar
  • 79.3k
37 votes
18 answers
4k views

Your challenge is to expand some brackets in a program's input as shown: Find a string s between two matching brackets [ and ], ...
MD XF's user avatar
  • 14.3k
5 votes
1 answer
1k views

From the sandbox! I2c or TWI, is a 2 way stream that uses 2 signal lines: SDA and SCK. This is used in sensors to communicate ...
tuskiomi's user avatar
  • 3,871
10 votes
1 answer
661 views

Introduction Braincopter is an esoteric Brainf*** derivative that encodes a Brainf*** program as an image. As a 2D language, it uses two additional commands; they rotate the instruction pointer (...
Copper's user avatar
  • 4,000
33 votes
6 answers
4k views

Background In 1870 Émile Baudot invented Baudot Code, a fixed-length character encoding for telegraphy. He designed the code to be entered from a manual keyboard with just five keys; two operated with ...
Jordan's user avatar
  • 12k
8 votes
1 answer
444 views

Everyone knows what run-length encoding is. It has been the subject of many code-golf challenges already. We'll be looking at a certain variation. Example ...
ericw31415's user avatar
  • 2,300
9 votes
4 answers
1k views

Introduction Everyone should know IPv6 by now. IPv6 has very long, cumbersome addresses. In 1996 some very intelligent people created a scheme to encode them much better in RFC 1924. For reasons I ...
Josef's user avatar
  • 193
14 votes
7 answers
1k views

Or else he will huff and puff and blow your house down! That was completely irrelevant. This challenge is actually about Huffman coding. The gist of it is the frequency of characters in a given text ...
El'endia Starman's user avatar
34 votes
16 answers
2k views

I don't like numbers, but I do like the Fibonacci sequence. I'm sure we could work something out. Please read one integer n from STDIN and output the nth Fibonacci number in base 26 (...
Drathier's user avatar
  • 1,859