"""SAS rendering: map digest bytes to emoji rows from the table below.""" # fmt: off # ruff: noqa _EMOJIS: str = '๐Ÿ˜†๐Ÿ˜๐Ÿ˜ญ๐Ÿ˜ด๐Ÿ˜‰๐Ÿ˜‡๐Ÿ˜Ž๐Ÿค”๐Ÿ˜ก๐Ÿคก๐Ÿ‘ป๐Ÿ‘ฝ๐Ÿค–๐Ÿ’€๐Ÿ’ฉ๐Ÿ‘€๐Ÿ‘๐Ÿ™๐Ÿšถ๐Ÿƒ๐Ÿ’ƒ๐Ÿคท๐Ÿคฆโœจโญ๐ŸŒ™๐ŸŒˆ๐Ÿ”ฅ๐Ÿ’ง๐ŸŒŠ๐ŸŒ€๐ŸŒ‚๐Ÿฑ๐Ÿถ๐Ÿญ๐Ÿน๐Ÿฐ๐ŸฆŠ๐Ÿป๐Ÿผ๐Ÿจ๐Ÿฆฅ๐Ÿฆจ๐Ÿฆ๐Ÿฎ๐Ÿท๐Ÿธ๐Ÿต๐Ÿ”๐Ÿง๐Ÿค๐Ÿฆ†๐Ÿฆ…๐Ÿฆ‰๐Ÿฆ‡๐Ÿบ๐Ÿด๐Ÿฆ„๐Ÿ๐Ÿ›๐ŸŒ๐Ÿž๐Ÿœ๐Ÿชฐ๐Ÿฆ‚๐Ÿฆ€๐Ÿฆž๐Ÿฆ‘๐Ÿ๐ŸฆŽ๐Ÿข๐ŸŸ๐Ÿฌ๐Ÿณ๐Ÿฆˆ๐Ÿ™๐Ÿš๐ŸŠ๐Ÿ‰๐Ÿฆ–๐Ÿซ๐Ÿฆ’๐Ÿฆ˜๐Ÿ˜๐Ÿฆ๐Ÿ๐Ÿ๐Ÿ‘๐Ÿ’๐Ÿ“๐Ÿฆƒ๐Ÿฆš๐Ÿฆœ๐Ÿฆข๐Ÿฆฉ๐Ÿพ๐ŸŒต๐ŸŒฒ๐ŸŒณ๐ŸŒด๐ŸŒฑ๐ŸŒฟ๐Ÿ€๐Ÿ๐Ÿƒ๐ŸŒน๐ŸŒท๐ŸŒป๐Ÿ’๐Ÿ„๐ŸŒฐ๐ŸŽ๐Ÿ๐ŸŠ๐Ÿ‹๐ŸŒ๐Ÿ‰๐Ÿ‡๐Ÿ“๐Ÿ’๐Ÿ‘๐Ÿ๐Ÿฅ๐Ÿ…๐Ÿ†๐Ÿฅ‘๐Ÿฅฆ๐ŸŒฝ๐Ÿฅ•๐Ÿฅ”๐Ÿž๐Ÿง€๐Ÿฅš๐Ÿฅž๐Ÿง‡๐Ÿ”๐ŸŸ๐Ÿ•๐ŸŒญ๐ŸŒฎ๐ŸŒฏ๐Ÿš๐Ÿ›๐Ÿœ๐Ÿ๐Ÿฃ๐Ÿช๐Ÿฐ๐Ÿฉ๐Ÿฌ๐Ÿญ๐Ÿฏ๐Ÿต๐Ÿถ๐Ÿบ๐Ÿท๐Ÿธ๐Ÿงƒโšฝ๐Ÿ€๐Ÿˆโšพ๐ŸŽพ๐Ÿ๐Ÿ‰๐ŸŽฑโ›ณ๐Ÿ†๐Ÿ…๐ŸŽฏ๐ŸŽณ๐Ÿ›ท๐Ÿช๐Ÿš—๐Ÿš•๐ŸšŒ๐Ÿšš๐Ÿšœ๐Ÿšฒ๐Ÿš†๐Ÿš‡๐ŸšŠ๐Ÿš€๐Ÿš๐Ÿ›ธโ›ต๐Ÿšขโš“โŒš๐Ÿ“ฑ๐Ÿ’ป๐Ÿ“ท๐Ÿ“น๐Ÿ“บ๐Ÿ“ปโฐ๐Ÿ’ก๐Ÿ”ฆ๐Ÿ”‹๐Ÿ”Œ๐Ÿ“–๐Ÿ“Œ๐Ÿ“Ž๐Ÿ”’๐Ÿ”‘๐Ÿ”จ๐Ÿ”ง๐Ÿงฒ๐Ÿ””๐ŸŽ๐ŸŽˆ๐ŸŽค๐ŸŽง๐ŸŽธ๐Ÿฅ๐ŸŽบ๐ŸŽน๐ŸŽจ๐ŸŽช๐ŸŽฒ๐Ÿงฉ๐Ÿ’Ž๐Ÿ‘‘๐Ÿ ๐Ÿซ๐Ÿฆ๐Ÿฐ๐Ÿญโ›ชโ›ฒโ›บ๐ŸŒ‰๐ŸŒ‹๐ŸŒ๐ŸงญโŒ›๐Ÿ“…๐Ÿ“ฆ๐Ÿ“๐Ÿ“Š๐Ÿ’ฐ๐Ÿ’ผ๐Ÿน๐Ÿ”ญ๐Ÿ”ฌ๐Ÿ”ฎ๐Ÿช‘๐Ÿšฝ๐Ÿšฟ๐Ÿ›๐Ÿงน๐Ÿงบ๐Ÿงฝ๐Ÿชฃ๐Ÿ‘•๐Ÿ‘—' _NAMES = 'laugh love cry sleep wink halo cool think angry clown ghost alien robot skull poop eyes thumbsup pray walk run dance shrug facepalm sparkle star moon rainbow fire drop wave cyclone umbrella cat dog mouse hamster rabbit fox bear panda koala sloth skunk lion cow pig frog monkey chicken penguin chick duck eagle owl bat wolf horse unicorn bee bug snail beetle ant fly scorpion crab lobster squid snake lizard turtle fish dolphin whale shark octopus shell crocodile dragon dino camel giraffe kangaroo elephant rhino goat ram sheep ape rooster turkey peacock parrot swan flamingo paw cactus pine tree palm plant herb clover maple leaf rose tulip sunflower bouquet mushroom chestnut apple pear orange lemon banana melon grape strawberry cherry peach pineapple kiwi tomato eggplant avocado broccoli corn carrot potato bread cheese egg pancake waffle burger fries pizza hotdog taco burrito rice curry ramen spaghetti sushi cookie cake donut candy lollipop honey tea sake beer wine martini juice soccer basketball football baseball tennis volley rugby snooker golf trophy medal target bowling sled kite car taxi bus truck tractor bike train metro tram rocket helicopter ufo boat ship anchor watch phone laptop camera video tv radio clock bulb flashlight battery plug book pin clip lock key hammer wrench magnet bell gift balloon microphone headphones guitar drum trumpet piano palette circus dice puzzle diamond crown house school bank castle factory church fountain tent bridge volcano globe compass hourglass calendar box folder chart money briefcase bow telescope microscope crystal chair toilet shower bathtub broom basket sponge bucket shirt dress'.split() # fmt: on assert len(_EMOJIS) == len(_NAMES) def format(data: bytes) -> str: """Render bytes as table emojis, two per row, names as outer labels; an odd trailing byte leaves the bottom right vacant.""" rows = [] for i in range(0, len(data), 2): row = f"{_NAMES[data[i]]:>10}{_EMOJIS[data[i]]}" if i + 1 < len(data): row += f"{_EMOJIS[data[i + 1]]}{_NAMES[data[i + 1]]:<10}" rows.append(row) return "\n".join(rows)