Off-the-Shelf C++ Hex Dump Code

前端 未结 7 1942
走了就别回头了
走了就别回头了 2020-12-05 15:05

I work a lot with network and serial communications software, so it is often necessary for me to have code to display or log hex dumps of data packets.

Every time I

7条回答
  •  醉话见心
    2020-12-05 15:27

    The unix tool xxd is distributed as part of vim, and according to http://www.vmunix.com/vim/util.html#xxd, the source for xxd is ftp://ftp.uni-erlangen.de:21/pub/utilities/etc/xxd-1.10.tar.gz. It was written in C and is about 721 lines. The only licensing information given for it is this:

    * Distribute freely and credit me,
    * make money and share with me,
    * lose money and don't ask me.
    

    The unix tool hexdump is available from http://gd.tuwien.ac.at/softeng/Aegis/hexdump.html. It was written in C and can be compiled from source. It's quite a bit bigger than xxd, and is distributed under the GPL.

提交回复
热议问题