Skip to contents

This function converts a 4-letter song code into a unique hex character. It checks against a list of already used hex codes to ensure that the generated hex character is unique. The function returns both the hex character and its numeric value.

Usage

four_letter_code_to_hex(code, used_hex_codes)

Arguments

code

A character string of length 4 representing the song code.

used_hex_codes

A character vector of already used hex codes to ensure uniqueness.

Value

A list containing two elements:

  • char: A single character representing the unique hex character.

  • value: The numeric value of the hex character.

Examples

if (FALSE) { # \dontrun{
hex_info <- convert_code_to_hex("WOWY", c("0x41", "0x42"))
print(hex_info)  # Output: List with char and value
} # }