gchq/CyberChef

manchester encoding / decoding

Open

#1 104 ouverte le 18 sept. 2020

Voir sur GitHub
 (4 commentaires) (0 réactions) (1 assigné)JavaScript (3 944 forks)batch import
featurehelp wantedoperation

Métriques du dépôt

Stars
 (34 843 stars)
Métriques de merge PR
 (Merge moyen 57j 13h) (62 PRs mergées en 30 j)

Description

manchester encoding (also known as phase encoding) is commonly used with telecommunications and data storage and would be a useful filter in CyberChef, particularly when working with SDR (software defined radio) sourced data

In short to encode, a input value of 1 becomes 01 and a input value of 0 becomes 10

encode(input) {

    foreach bit in input {
        if bit == 0 {
            output.append(1);
            output.append(0);
        } else {
            output.append(0);
            output.append(1);
        }

    return output;
}

Guide contributeur