New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zappem.net/pub/debug/xxd

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zappem.net/pub/debug/xxd

  • v1.0.0
  • Go
  • Socket score

Version published
Created
Source

xxd - a Go package for generating hex dumps

Overview

Under Linux there is a handy stand alone command xxd that can be used to generate HEX dumps of binary data files. This package reproduces one of its output formats: the output of xxd -g1.

With data := []bytes{0x00, 0xf0, 0x07, ... 0x5b, 0x00, 0x20}, of 64 bytes total length, for example, xxd.Print(0, data) will generate the following output:

00000000: 00 f0 07 20 c5 63 00 20 8f 31 00 20 79 31 00 20  ... .c. .1. y1. 
00000010: 95 31 00 20 9b 31 00 20 a1 31 00 20 00 00 00 00  .1. .1. .1. ....
00000020: 00 00 00 00 00 00 00 00 00 00 00 00 31 3a 00 20  ............1:. 
00000030: a7 31 00 20 00 00 00 00 f1 3a 00 20 11 5b 00 20  .1. .....:. .[. 

Each line is aligned to a multiple of 16 bytes, but data is output starting at the offset indicated by the first argument. As such, xxd.Print(5, data) will generate:

00000000:                00 f0 07 20 c5 63 00 20 8f 31 00       ... .c. .1.
00000010: 20 79 31 00 20 95 31 00 20 9b 31 00 20 a1 31 00   y1. .1. .1. .1.
00000020: 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ...............
00000030: 00 31 3a 00 20 a7 31 00 20 00 00 00 00 f1 3a 00  .1:. .1. .....:.
00000040: 20 11 5b 00 20                                    .[. 

Automated documentation for this Go package is available from Go
Reference.

License info

The xxd package is distributed with the same BSD 3-clause license as that used by golang itself.

Reporting bugs and feature requests

The xxd package was developed purely out of self-interest to help debug other programs and packages. Should you find a bug or want to suggest a feature addition, please use the bug tracker.

FAQs

Package last updated on 24 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc