Home Explore Blog CI



nushell

1st chunk of `lang-guide/chapters/types/basic_types/binary.md`
8b57555c01a8cda13c5d6bb257ef52896784009a0658e4240000000100000483
# Binary

|                       |                                                              |
| --------------------- | ------------------------------------------------------------ |
| **_Description:_**    | Represents binary data                                       |
| **_Annotation:_**     | `binary`                                                     |
| **_Literal Syntax:_** | `0x[ffffffff]` - hex-based binary representation             |
|                       | `0o[1234567]` - octal-based binary representation            |
|                       | `0b[10101010101]` - binary-based binary representation       |
| **_Casts:_**          | [`into binary`](/commands/docs/into_binary.md)               |
| **_See also:_**       | [Types of data - Binary](/book/types_of_data.md#binary-data) |

## Additional Language Notes

1. Incomplete bytes are left-padded with zeros.

2. Spaces can be used to improve readability. For example, `0x[ffff ffff]`.

## Common commands that can be used with `binary`

- `into bits`
- `bits` subcommands (see `help bits` for a list)
- `bytes` subcommands (see `help bytes` for a list)
- `encode`
- `take`

Title: Binary Data Type in Nu
Summary
This section describes the 'binary' data type in the Nu programming language. It covers the annotation used to represent binary data, literal syntaxes for hex, octal, and binary representations (including padding and readability with spaces), casting using 'into binary', and related commands like 'into bits', 'encode', and 'take'.