Created
November 5, 2019 11:19
-
-
Save mwiemarc/4cb6f43196ff24490a6ade7df67b1d67 to your computer and use it in GitHub Desktop.
decode text from hexvalues (in colors)
This file contains hidden or 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
local str = | |
'8BC337C54C327C337C338C54C329C323C327C332C54C93C323C326C323C327C32BC332C327C337C66C54C322CB9C337C337C54C322CB9C337C54C99CB9C336C329C323C332C344C323C327CBBC326C323C332C54C322C323C336C54C8AC323C324C327CB9C337CBACB9C332C322C323C54C327C326C336C323C54C336C333C338C323C332C54C97C333C334C324C338C3B713AACBBC326C323C336C54C337C327C332C322C68C54C87CBAC323C336C54C33BC327C336C54C326CB9CBAC323C332C54C326C323C336CB9C339C337C325C323C324C339C332C322C323C332C66C54C322CB9C337C337C54C322CB9C337C54C99CB9C338C323C336C327CB9C32AC66C54CB9C339C337C54C322C323C32BC54C322C327C323C337C323C54C97C333C334C324C338C3B713AACBBC326C323C336C54C325C323C32BCB9CBBC326C338C54C337C327C332C322C66C54C322C323C332C54CA4CB9C332C325C54C322C323C337C54C88CB9C332C322C323C332C32BC327C338C325C32AC327C323C322C337C54CBAC323C344C323C327CBBC326C332C323C338C68C54C96C323C338C344C338C66C54C33BC333C54C33BC327C336C54C322CB9C337C54C33BC327C337C337C323C332C66C54C32BC3B713A4CBBC326C338C323C54C327CBBC326C66C54C322CB9C337C337C54C95C326C336C54C337C333C54C33AC327C323C32AC323C54C326C333CBBC326C336CB9C332C325C327C325C323C54C99C327C338C325C32AC327C323C322C323C336C54C322C323C336C54C8AC323C324C327CB9C337C54C323C32AC327C32BC327C332C327C323C336C338C66C54C33BC327C323C54C95C326C336C54C329C3B713A4C332C332C338C68C54C8AC327C323C54C88CB9C332C322C323C332C32BC327C338C325C32AC327C323C322C323C336C54C32BC327C338C54C322C323C336C54C326C3B713A4CBBC326C337C338C323C332C54CA2C333C337C327C338C327C333C332C54C324C327C332C322C323C338C54C95C326C336C54C344C33BC323C327C324C323C32AC32AC333C337C54C327C332C54C33ACB9C332C54C89C32AC323C323C324C337C54C93C323C326C323C327C32BC33AC323C336C337C338C323CBBC329C68C54CA9C323C332C332C54C95C326C336C54C324C323C336C338C327C325C54C337C323C327C322C66C54CBAC336C327C332C325C338C54C32BC327C336C54C6BC6AC54C336C333C338C323C54CA5C323C327C322C323C332C329C333C334C324C338C3B713AACBBC326C323C336C54C344C339C32BC54C88C323C33BC323C327C337C66C54C322CB9C337C337C54C337C327C323C54C338C333C338C54C337C327C332C322C66C54C322CB9C332C332C54C33BC323C336C322C323C54C327CBBC326C54C8BC339CBBC326C54CBAC323C32AC333C326C332C323C332C68C54CA8C327C323C32AC54C93C32AC3B713AACBBC329C66C54C82C9ACB9C32BC323C84C68' | |
local byteStr = '' | |
for c in str:gmatch('.') do | |
local b = tonumber(c, 16) or nil -- get decimal for char | |
byteStr = b and byteStr .. string.char(b + 46) or byteStr -- append char | |
end | |
local charStr = '' | |
for bytes in byteStr:gmatch('([^:]+)') do -- get bytes for every char | |
local bytesArr = {} | |
for b in bytes:gmatch('([^/]+)') do -- get every byte for char | |
table.insert(bytesArr, b) | |
end | |
if bytesArr[1] then -- has bytes | |
charStr = string.format('%s%s', charStr, tostring(string.char(bytesArr[1] or 0, bytesArr[2] or 0, bytesArr[3] or 0, bytesArr[4] or 0))) -- append char | |
end | |
end | |
print(charStr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment