Tag Archives: decode

Encode and decode FourCC codes, in Python

Encode and decode FourCC codes, in Python

Convert the string “H264” to an integer code: sum([ord(c) << (i * 8) for i, c in enumerate(“H264″)]) Enter fullscreen modeExit fullscreen mode Convert the integer code (0x34363248) again to a string: ”.be part of([chr((0x34363248 >> (i * 8)) & 0xff) for i in range(4)]) Enter fullscreen modeExit fullscreen mode See this gist: https://gist.github.com/eliteraspberries/b017f998c97c395881f0d2f05a08ec60 Read…

Read More

LeetCode 91. Decode Ways (javascript solution) – JavaScript Dev Feed

LeetCode 91. Decode Ways (javascript solution) Description: A message containing letters from A-Z can be encoded into numbers using the following mapping: ‘A’ -> “1”‘B’ -> “2”…‘Z’ -> “26”To decode an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple…

Read More