# Naming functions for \`\[\]const u8\` vs \`\[\]u8\`

**URL:** <https://ziggit.dev/t/naming-functions-for-const-u8-vs-u8/18591>\
**Category:** Help\
**Tags:** memory-management\
**Created:** [November 25, 2026, 8:49pm UTC](https://ziggit.dev/t/naming-functions-for-const-u8-vs-u8/18591 "2026-11-25T20:49:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vexo413](https://ziggit.dev/user_avatar/ziggit.dev/vexo413/32/10418_2.png) [@Vexo413](https://ziggit.dev/u/Vexo413)\
**Post date:** [November 25, 2026, 8:49pm UTC](https://ziggit.dev/t/naming-functions-for-const-u8-vs-u8/18591/1 "2026-11-25T20:49:48Z")

</div>

I am adding a `compress` method to the `tar` struct in the zig std library, just to see if I can and maybe get it merged eventually. Anyways, there is this `Header` struct, which is has a bytes field of type `*const [SIZE]u8` and it is const because you don’t need to edit it for the already implemented `extract` method. The bytes correspond to an actual tar header in a tar archive, and has functions like this:

```zig
    pub fn prefix(header: Header) []const u8 {
        return header.str(345, 155);
    }

```

Where there are the magic indices where the data is, and this is useful to keep these indices out of actual logic. Right now they are also returning `[]const u8` so it isn’t mutable.  
Should I edit `Header` to be mutable, and have the functions return `[]u8` too, I just didn’t want to give the reading `extract` the `[]u8`.

After writing, this actually sounds kind of stupid, just use mutable slices, but still, what are your thoughts?
