| 1 | // Copyright (c) 2025 Alexander Medvednikov. All rights reserved. |
| 2 | // Use of this source code is governed by an MIT license |
| 3 | // that can be found in the LICENSE file. |
| 4 | module binary |
| 5 | |
| 6 | // Unions used across the little endian/big endian conversion routines. |
| 7 | |
| 8 | union U16 { |
| 9 | mut: |
| 10 | b [2]u8 |
| 11 | u u16 |
| 12 | } |
| 13 | |
| 14 | union U32 { |
| 15 | mut: |
| 16 | b [4]u8 |
| 17 | u u32 |
| 18 | } |
| 19 | |
| 20 | union U64 { |
| 21 | mut: |
| 22 | b [8]u8 |
| 23 | u u64 |
| 24 | } |
| 25 | |
| 26 | union F32 { |
| 27 | mut: |
| 28 | b [4]u8 |
| 29 | u f32 |
| 30 | } |
| 31 |