Created
February 24, 2021 00:04
-
-
Save oliviergimenez/26236ed51d4d3a338637867f722992e3 to your computer and use it in GitHub Desktop.
Decoding the hidden message in Perseverance parachute with R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
options(warn = -1) # suppress warnings | |
# read in the rings as character strings | |
ring <- data.frame(inner_ring = "00000001000000000001000001001000000001010001111111111111111111111111111111111111", | |
middle_ring_first = "00000011010000001001000000011100000010000000010100000001100100011111111111111111", | |
middle_ring_second = "00000101000000001000000000100100000011100000000111000001001100011111111111111111") | |
end <- seq(10, 80, by = 10) # create vector of upper bound for each chunk of 10 bits | |
ring %>% | |
pivot_longer(cols = 1:3, names_to = "ring", values_to = "char") %>% | |
separate(col = char, into = paste0("chunk ", 1:8), sep = end) %>% # split in chunks of 10 bits | |
mutate(across(starts_with("chunk"), strtoi, base = 2), # convert binary string to integer | |
across(starts_with("chunk"), ~ . + 64), # add 64 to get ascii code | |
across(starts_with("chunk"), gtools::chr)) # return character corresp to ascii code | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The output is: