| 1 |
// SPDX-License-Identifier: MPL-2.0 |
| 2 |
// (c) Hare authors <https://harelang.org> |
| 3 |
|
| 4 |
use rt; |
| 5 |
|
| 6 |
// Sets all bytes in a slice to zero. This is suitable for erasing private data |
| 7 |
// from a slice. |
| 8 |
export fn zero(buf: []u8) void = { |
| 9 |
rt::memset(buf: *[*]u8, 0, len(buf)); |
| 10 |
}; |