Skip to content

Latest commit

 

History

History
78 lines (61 loc) · 1.76 KB

File metadata and controls

78 lines (61 loc) · 1.76 KB
title bits not
categories bits
version 0.103.0
bits Performs logical negation on each bit.
usage Performs logical negation on each bit.
editLink false
contributors false

bits not for bits

Performs logical negation on each bit.

Signature

> bits not {flags}

Flags

  • --signed, -s: always treat input number as a signed number
  • --number-bytes, -n {int}: the size of unsigned number in bytes, it can be 1, 2, 4, 8, auto

Input/output types:

input output
binary binary
int int
list<binary> list<binary>
list<int> list<int>

Examples

Apply logical negation to a list of numbers

> [4 3 2] | bits not
╭───┬─────╮
│ 0251 │
│ 1252 │
│ 2253 │
╰───┴─────╯

Apply logical negation to a list of numbers, treat input as 2 bytes number

> [4 3 2] | bits not --number-bytes 2
╭───┬───────╮
│ 065531 │
│ 165532 │
│ 265533 │
╰───┴───────╯

Apply logical negation to a list of numbers, treat input as signed number

> [4 3 2] | bits not --signed
╭───┬────╮
│ 0-5 │
│ 1-4 │
│ 2-3 │
╰───┴────╯

Apply logical negation to binary data

> 0x[ff 00 7f] | bits not
Length: 3 (0x3) bytes | printable whitespace ascii_other non_ascii
00000000:   00 ff 80                                             0××