aladdinding
V2EX  ›  问与答

类似这样格式的网络协议数据包展示是怎么生成的

  •  
  •   aladdinding · Apr 25, 2024 · 1322 views
    This topic created in 774 days ago, the information mentioned may be changed or developed.
    	// +---------------+---------------+---------------+
    	// |    Tag        |     Length    |     Value     |
    	// | uint32(4byte) | uint32(4byte) |     n byte    |
    	// +---------------+---------------+---------------+
    

    我猜测应该不会是手敲吧

    有没有能直接生成的

    想把代码里面的注释写的美观漂亮一些

    4 replies    2024-04-25 16:41:49 +08:00
    aladdinding
        1
    aladdinding  
    OP
       Apr 25, 2024
    在 rfc 里面也经常看到这样的数据包展示
    tD3H4t5jUowkHZca
        2
    tD3H4t5jUowkHZca  
       Apr 25, 2024   ❤️ 1
    如果你用 vim/nvim ,可以试试这个插件:

    https://github.com/dhruvasagar/vim-table-mode
    Donaldo
        3
    Donaldo  
       Apr 25, 2024   ❤️ 1
    https://ozh.github.io/ascii-tables/
    或者以 ASCII Table Generator 为关键字搜索,有不少工具。
    retanoj
        4
    retanoj  
       Apr 25, 2024
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5461 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 08:58 · PVG 16:58 · LAX 01:58 · JFK 04:58
    ♥ Do have faith in what you're doing.