gchq / gchq/CyberChef

Operation request: pack integer, unpack integer

Open
#2,138 1 comment 0 reactions 0 assignees View on GitHub
operation
Dominant language
JavaScript
Stars
35.8k
Forks
4.1k
Avg merge
2d 26m
Merged PRs (30d)
33

Description

## Summary

### Pack integer

Packs integer values into their binary representation

### Unpack integer

Unpacks integer values from their binary representation

### Options

**Size in bits** (default values: 8, 16, 32, 64 and custom) – Size of the integer value in bits
**Signed** (for unpack only) – Decode as signed or as unsigned
**Separator** – For pack: separator of input numbers, for unpack – separator of output numbers
**Format** (Raw/Hex) – Input/output binary data format (raw bytes or hex)
**Endian** (Big/Little) – The endianness of input/output binary data

## Example Input

Options for these examples:
**Size in bits**: 32
**Signed**: false
**Endian**: big

### Pack integer

```text
19022842, 1234567
```

### Unpack integer

If hex format is selected:

```text
01 22 43 fa 00 12 d6 87
```

Or same in raw bytes (if raw format is selected)

## Example Output

### Pack integer

If hex format is selected:

```text
01 22 43 fa 00 12 d6 87
```

Or same in raw bytes (if raw format is selected)

### Unpack integer

If comma separator is selected:

```text
19022842, 1234567
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.