gchq/CyberChef

manchester encoding / decoding

Open

#1104 aperta il 18 set 2020

Vedi su GitHub
 (4 commenti) (0 reazioni) (1 assegnatario)JavaScript (3944 fork)batch import
featurehelp wantedoperation

Metriche repository

Star
 (34.843 star)
Metriche merge PR
 (Merge medio 57g 13h) (62 PR mergiate in 30 g)

Descrizione

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;
}

Guida contributor