Git Product home page Git Product logo

baudot's Introduction

博多码(Baudot Code)及其各种变体的编码解码工具

博多码(Baudot Code)是19世纪下半叶至20世纪上半叶被广泛用于电传打字机的一种字符集,由法国人Émile Baudot在1870年发明.

原版的博多码在早期在英国被推广使用,但是真正被大量普及是Donald Murray对电传打字机传输消息的改良由此在1901年对Baudot Code的改良,他的改良版本被成为Baudot-Murray Code,此后被标准化为International Telegraph Alphabet No.2(ITA2, 原版为ITA1), 它算得上是ASCII码的前身.

这个库实现了对ITA1和ITA2(standard及USTTY变体)编解码的功能.

Example

import (
    "github.com/hsldymq/baudot"
)

func main() {
    codec := baudot.newITA1(false)  // true:包含无效数据编解码数据将忽略, false:有无效数据会产生error
    // baudot.newITA2(false)
    // baudot.newUSTTY(false)

    codes, err := codec.Encode("X&Y")    // 编码消息为字节数组
    if err {
        // handle error
    }

    //////
    message, err := codec.Decode(codes)  // 解码博多码为消息字符串
    if err {
        // handle error
    }

}

baudot's People

Contributors

hsldymq avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

sisy110

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.