{"id":16631010,"url":"https://github.com/zmb3/hexdump","last_synced_at":"2025-03-21T15:31:25.320Z","repository":{"id":16826573,"uuid":"19585882","full_name":"zmb3/hexdump","owner":"zmb3","description":"A header-only utility for writing hexdump-formatted data to C++ streams.","archived":false,"fork":false,"pushed_at":"2022-06-20T00:39:24.000Z","size":5,"stargazers_count":59,"open_issues_count":2,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-01T07:34:59.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zmb3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-08T19:21:41.000Z","updated_at":"2025-01-14T18:24:42.000Z","dependencies_parsed_at":"2022-07-22T00:29:44.335Z","dependency_job_id":null,"html_url":"https://github.com/zmb3/hexdump","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmb3%2Fhexdump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmb3%2Fhexdump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmb3%2Fhexdump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmb3%2Fhexdump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmb3","download_url":"https://codeload.github.com/zmb3/hexdump/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244146120,"owners_count":20405768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T04:50:31.374Z","updated_at":"2025-03-21T15:31:25.063Z","avatar_url":"https://github.com/zmb3.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"hexdump\n=======\n\nhexdump is a simple wrapper that allows you to display the contents of memory using C++ streams.  The output is formatted similar to the Linux tool of the same name.\n\nFor example, suppose you have an array of data:\n\n```cpp\nunsigned char data[150];\nunsigned char c = 0;\nfor (auto\u0026 val : data)\n{\n    val = c++;\n}\n```\n\nYou can display the hexdump of this array with a single line:\n\n```cpp\nstd::cout \u003c\u003c Hexdump(data, sizeof(data)) \u003c\u003c std::endl\n```\n\nThis produces the following output:\n```\n0x000000: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f  ................\n0x000010: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f  ................\n0x000020: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f   !\"#$%\u0026'()*+,-./\n0x000030: 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f  0123456789:;\u003c=\u003e?\n0x000040: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f  @ABCDEFGHIJKLMNO\n0x000050: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f  PQRSTUVWXYZ[\\]^_\n0x000060: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f  `abcdefghijklmno\n0x000070: 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f  pqrstuvwxyz{|}~.\n0x000080: 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f  ................\n0x000090: 90 91 92 93 94 95                                ......\n```\n\n## Configuration\n\nHexdump allows you to configure the length of each row (number of bytes displayed).  Additionally, the ASCII text display can be disabled.  To configure these features, use the `CustomHexdump` class template.  The class accepts two template arguments, the first being the length of the row, and the second being a boolean indicating whether or not the ASCII text should be displayed.\n\nFor example:\n\n```cpp\n// row length of 8, with ASCII\nstd::cout \u003c\u003c CustomHexdump\u003c8, true\u003e(data, sizeof(data)) \u003c\u003c std::endl;\n```\n\nProduces:\n```\n0x000000: 00 01 02 03 04 05 06 07  ........\n0x000008: 08 09 0a 0b 0c 0d 0e 0f  ........\n0x000010: 10 11 12 13 14 15 16 17  ........\n0x000018: 18 19 1a 1b 1c 1d 1e 1f  ........\n0x000020: 20 21 22 23 24 25 26 27   !\"#$%\u0026'\n0x000028: 28 29 2a 2b 2c 2d 2e 2f  ()*+,-./\n0x000030: 30 31 32 33 34 35 36 37  01234567\n0x000038: 38 39 3a 3b 3c 3d 3e 3f  89:;\u003c=\u003e?\n0x000040: 40 41 42 43 44 45 46 47  @ABCDEFG\n0x000048: 48 49 4a 4b 4c 4d 4e 4f  HIJKLMNO\n0x000050: 50 51 52 53 54 55 56 57  PQRSTUVW\n0x000058: 58 59 5a 5b 5c 5d 5e 5f  XYZ[\\]^_\n0x000060: 60 61 62 63 64 65 66 67  `abcdefg\n0x000068: 68 69 6a 6b 6c 6d 6e 6f  hijklmno\n0x000070: 70 71 72 73 74 75 76 77  pqrstuvw\n0x000078: 78 79 7a 7b 7c 7d 7e 7f  xyz{|}~.\n0x000080: 80 81 82 83 84 85 86 87  ........\n0x000088: 88 89 8a 8b 8c 8d 8e 8f  ........\n0x000090: 90 91 92 93 94 95        ......\n```\nAnd\n\n```cpp\n// row length of 32, with no ASCII text\nstd::cout \u003c\u003c CustomHexdump\u003c32, false\u003e(data, sizeof(data)) \u003c\u003c std::endl;\n```\n\nProduces:\n```\n0x000000: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f \n0x000020: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f \n0x000040: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f \n0x000060: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f \n0x000080: 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 \n```\n## Usage\n\nHexdump is header-only.  To use it, simply place the `Hexdump.hpp` file on your include path and `#include` it.  See the example for reference.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmb3%2Fhexdump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmb3%2Fhexdump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmb3%2Fhexdump/lists"}