
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
viterbi
Advanced tools
This project is a fork of https://github.com/xukmin/viterbi that introduces Python support, enabling effortless utilization of the Viterbi module within the Python environment.
pip install viterbi
The following is a convolutional encoder with a constraint length of 7. The diagram indicates the binary values and polynomial form, indicating the left-most bit is the most-significant-bit (MSB). The generating polynomials are 1011011 and 1111001 can be alternatively expressed in octal as 133 and 171, respectively.
Expressed in code as:
from viterbi import Viterbi
dot11a_codec = Viterbi(7, [0o133, 0o171])
You can use the viterbi decoder like this:
from viterbi import Viterbi
dot11a_codec = Viterbi(7, [0o133, 0o171])
bits = [0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0]
output = dot11a_codec.encode(bits)
# [0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1]
dot11a_codec.decode(output)
# [0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0]
This library also allows you to puncture the original encoded data by specifying a puncture pattern or decode data that has already been punctured.
from viterbi import Viterbi
# Puncture Pattern: [1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1]
dot11a_codec = Viterbi(7, [0o133, 0o171], [1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1])
You can find the way to use the Viterbi decoder in C++ in the README of the original project.
FAQs
A Convolutional Encoder and Viterbi Decoder in Python/C++.
We found that viterbi 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
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.