Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
This Python module helps with converting Advent of Code ASCII art letters into plain characters. At the moment, it only supports 6-pixel-tall characters as seen in 2016 Day 8, 2019 Days 8 and 11, and 2021 Day 13.
Support for 10-pixel-tall characters (2018 Day 10) is coming soon.
Put simply, it converts this to ABC
:
██ ███ ██
█ █ █ █ █ █
█ █ ███ █
████ █ █ █
█ █ █ █ █ █
█ █ ███ ██
This module can be installed from PyPI:
$ pip install advent-of-code-ocr
Using this module is pretty easy. By default, this module recognizes #
as a filled pixel and .
as an empty pixel. However, you can change this using the fill_pixel
and empty_pixel
keywork arguments respectively.
from advent_of_code_ocr import convert_6
print(convert_6(".##.\n#..#\n#..#\n####\n#..#\n#..#"))
# A
print(convert_6(" $$ \n$ $\n$ $\n$$$$\n$ $\n$ $", fill_pixel="$", empty_pixel=" "))
# A
You can also convert data that you have in a NumPy array or a nested list:
from advent_of_code_ocr import convert_array_6
array = [
[0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0],
[1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1],
[1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0],
[1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0],
[1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1],
[1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0],
]
print(convert_array_6(array, fill_pixel=1, empty_pixel=0))
# AOC
Advent of Code is a registered trademark of Eric K Wastl in the United States.
FAQs
Convert Advent of Code ASCII art
We found that advent-of-code-ocr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.