# 3sl , a Sweet Hex Viewer

**URL:** <https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933>\
**Category:** Showcase\
**Created:** [April 14, 2026, 7:48pm UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933 "2026-04-14T19:48:06Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![asibahi](https://ziggit.dev/user_avatar/ziggit.dev/asibahi/32/5416_2.png) [@asibahi](https://ziggit.dev/u/asibahi)\
**Post date:** [April 14, 2026, 7:48pm UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/1 "2026-04-14T19:48:06Z")

</div>

Celebrating `0.16.0`, I was playing around the `master` branch for a couple of days and I wrote a little hex viewer with colors. [Intro article with screenshots](https://ar-ms.me/thoughts/3sl-a-sweet-hex-utility/) and [the repo](https://git.sr.ht/~asibahi/3sl). It is a pretty small project with no dependencies.

 ![image](https://ziggit.dev/uploads/default/original/2X/1/13e4ff943645a25718ed5fdf89f9f413b363fe02.png)

I hope y’all like it.

---

<div class="post-metadata">

**Author:** ![Slice](https://ziggit.dev/user_avatar/ziggit.dev/slice/32/8224_2.png) [@Slice](https://ziggit.dev/u/Slice)\
**Post date:** [April 14, 2026, 9:06pm UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/2 "2026-04-14T21:06:35Z")

</div>

Very cool!

---

<div class="post-metadata">

**Author:** ![pachde](https://ziggit.dev/user_avatar/ziggit.dev/pachde/32/2485_2.png) [@pachde](https://ziggit.dev/u/pachde)\
**Post date:** [April 15, 2026, 12:11am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/3 "2026-04-15T00:11:30Z")

</div>

So what do these colors signify? Or is this just a pretty rainbow?

---

<div class="post-metadata">

**Author:** ![vulpesx](https://ziggit.dev/user_avatar/ziggit.dev/vulpesx/32/3989_2.png) [@vulpesx](https://ziggit.dev/u/vulpesx)\
**Post date:** [April 15, 2026, 5:28am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/4 "2026-04-15T05:28:02Z")

</div>

They signify the whimsy of the author :3

---

<div class="post-metadata">

**Author:** ![asibahi](https://ziggit.dev/user_avatar/ziggit.dev/asibahi/32/5416_2.png) [@asibahi](https://ziggit.dev/u/asibahi)\
**Post date:** [April 15, 2026, 7:17am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/5 "2026-04-15T07:17:15Z")

</div>

First link in the article: [your hex editor should color-code bytes](https://simonomi.dev/blog/color-code-your-bytes/)

---

<div class="post-metadata">

**Author:** ![Etienne\_Parmentier](https://ziggit.dev/letter_avatar_proxy/v4/letter/e/9dc877/32.png) [@Etienne\_Parmentier](https://ziggit.dev/u/Etienne_Parmentier)\
**Post date:** [April 15, 2026, 9:44am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/6 "2026-04-15T09:44:29Z")

</div>

This is genius ! I want this in my vscode hex viewer now !

---

<div class="post-metadata">

**Author:** ![WeeBull](https://ziggit.dev/user_avatar/ziggit.dev/weebull/32/6828_2.png) [@WeeBull](https://ziggit.dev/u/WeeBull)\
**Post date:** [April 15, 2026, 12:18pm UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/7 "2026-04-15T12:18:45Z")

</div>

I like it. Is there logic to the name `3sl`? Trying to think how I’d remember I had it.

---

<div class="post-metadata">

**Author:** ![asibahi](https://ziggit.dev/user_avatar/ziggit.dev/asibahi/32/5416_2.png) [@asibahi](https://ziggit.dev/u/asibahi)\
**Post date:** [April 15, 2026, 1:16pm UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/8 "2026-04-15T13:16:56Z")

</div>

Arabic word for Honey.

---

<div class="post-metadata">

**Author:** ![asibahi](https://ziggit.dev/user_avatar/ziggit.dev/asibahi/32/5416_2.png) [@asibahi](https://ziggit.dev/u/asibahi)\
**Post date:** [May 2, 2026, 10:49am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/9 "2026-05-02T10:49:05Z")

</div>

Hey. I made a few updates to this to make it even better.

You can view the changelog here: [https://git.sr.ht/~asibahi/3sl/tree/v0.1.4/item/CHANGELOG.md](https://git.sr.ht/~asibahi/3sl/tree/v0.1.4/item/CHANGELOG.md)

The biggest change is the `--windows` or `-w` flag, where you can segment the file into different sections, skipping some if needed. Here is a simple screenshot example:

 ![Screenshot 2026-05-02 at 1.47.23 PM](https://ziggit.dev/uploads/default/original/2X/c/cd393e6d156a57f3f782352e5da0753876b8351f.png)

There is also some `--range` flag to get only a section of the file, and a small way to adjust color choices (customizable via environment flags). You can find all the necessary info with `--help`.

---

<div class="post-metadata">

**Author:** ![asibahi](https://ziggit.dev/user_avatar/ziggit.dev/asibahi/32/5416_2.png) [@asibahi](https://ziggit.dev/u/asibahi)\
**Post date:** [May 27, 2026, 6:13am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/10 "2026-05-27T06:13:11Z")

</div>

Yo I added —base64 flag to get the binary out in base64. For when you want to share the binary in base64 .

---

<div class="post-metadata">

**Author:** ![asibahi](https://ziggit.dev/user_avatar/ziggit.dev/asibahi/32/5416_2.png) [@asibahi](https://ziggit.dev/u/asibahi)\
**Post date:** [May 27, 2026, 8:50am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/11 "2026-05-27T08:50:18Z")

</div>

@lalinsky no reason to add the LLM tag

---

<div class="post-metadata">

**Author:** ![lalinsky](https://ziggit.dev/user_avatar/ziggit.dev/lalinsky/32/3720_2.png) [@lalinsky](https://ziggit.dev/u/lalinsky)\
**Post date:** [May 27, 2026, 9:07am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/12 "2026-05-27T09:07:19Z")

</div>

I’m sorry, I was going by the commit mentioning fixes by gemini.

---

<div class="post-metadata">

**Author:** ![asibahi](https://ziggit.dev/user_avatar/ziggit.dev/asibahi/32/5416_2.png) [@asibahi](https://ziggit.dev/u/asibahi)\
**Post date:** [May 27, 2026, 9:09am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/13 "2026-05-27T09:09:59Z")

</div>

Fair enough. I just threw the files at web Gemini to see if it found any bugs. No agents tho.

---

<div class="post-metadata">

**Author:** ![knightpp](https://ziggit.dev/user_avatar/ziggit.dev/knightpp/32/2423_2.png) [@knightpp](https://ziggit.dev/u/knightpp)\
**Post date:** [May 30, 2026, 9:28am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/14 "2026-05-30T09:28:14Z")

</div>

There’s no `-Dcpu=baseline` option when building the app.

You should probably use `standardOptimizeOption` and `standardTargetOptions`.

```zig
	const mod = b.createModule(.{
		.root_source_file = b.path("src/main.zig"),
		.target = b.graph.host, // <<<<<<<<<<<<<<<<<<<<<<<<<<
		.optimize = switch (b.release_mode) { // <<<<<<<<<<<<
			.off => .Debug,
			.any, .fast => .ReleaseFast,
			.safe => .ReleaseSafe,
			.small => .ReleaseSmall,
		},
	});

```

---

<div class="post-metadata">

**Author:** ![asibahi](https://ziggit.dev/user_avatar/ziggit.dev/asibahi/32/5416_2.png) [@asibahi](https://ziggit.dev/u/asibahi)\
**Post date:** [May 30, 2026, 2:01pm UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/15 "2026-05-30T14:01:33Z")

</div>

~~Feel free to send me a patch if you feel that’s important. I don’t know that the usual way to do these things is. The current setup works just fine for me.~~

Just added the standard options in 0.1.8.

---

<div class="post-metadata">

**Author:** ![Devsuner](https://ziggit.dev/user_avatar/ziggit.dev/devsuner/32/8190_2.png) [@Devsuner](https://ziggit.dev/u/Devsuner)\
**Post date:** [June 2, 2026, 7:36am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/16 "2026-06-02T07:36:37Z")

</div>

Hello, Im a beginner with Zig, and I have a probably silly question about the code in the source .  
I don’t see any code that uch as cwd.close().Is closing this kind of handle optional?

---

<div class="post-metadata">

**Author:** ![asibahi](https://ziggit.dev/user_avatar/ziggit.dev/asibahi/32/5416_2.png) [@asibahi](https://ziggit.dev/u/asibahi)\
**Post date:** [June 2, 2026, 9:24am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/17 "2026-06-02T09:24:30Z")

</div>

My understanding is that the operating system will clean used resources up (including memory and open files) after the process exits.

---

<div class="post-metadata">

**Author:** ![Devsuner](https://ziggit.dev/user_avatar/ziggit.dev/devsuner/32/8190_2.png) [@Devsuner](https://ziggit.dev/u/Devsuner)\
**Post date:** [June 2, 2026, 9:39am UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/18 "2026-06-02T09:39:49Z")

</div>

Thanks, I know that

---

<div class="post-metadata">

**Author:** ![asibahi](https://ziggit.dev/user_avatar/ziggit.dev/asibahi/32/5416_2.png) [@asibahi](https://ziggit.dev/u/asibahi)\
**Post date:** [October 29, 2026, 7:13pm UTC](https://ziggit.dev/t/3sl-a-sweet-hex-viewer/14933/19 "2026-10-29T19:13:19Z")

</div>

tiny update but I upgraded `build.zig` to 0.17.0.
