Skip to content

Instantly share code, notes, and snippets.

@fdncred
Last active August 4, 2022 02:14
Show Gist options
  • Select an option

  • Save fdncred/6f5fb149c014c6de039401a6a07d3046 to your computer and use it in GitHub Desktop.

Select an option

Save fdncred/6f5fb149c014c6de039401a6a07d3046 to your computer and use it in GitHub Desktop.

Revisions

  1. fdncred revised this gist Aug 4, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -65,7 +65,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - [x] `bits rol` aka `rotate --left`
    - bitwise shift left move a bit left and adds it to the right

    - [ ] `bits ror` aka `rotate --right`
    - [x] `bits ror` aka `rotate --right`
    - bitwise shift right move a bit right and adds it to the left

    - [x] `bits and` aka `&`
  2. fdncred revised this gist Aug 4, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -62,7 +62,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - [x] `bits shr` aka `shift --right` aka `>>`
    -bitwise shift right moves bits right

    - [ ] `bits rol` aka `rotate --left`
    - [x] `bits rol` aka `rotate --left`
    - bitwise shift left move a bit left and adds it to the right

    - [ ] `bits ror` aka `rotate --right`
  3. fdncred revised this gist Aug 1, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -59,7 +59,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - [x] `bits shl` aka `shift --left` aka `<<`
    -bitwise shift left moves bits left

    - [ ] `bits shr` aka `shift --right` aka `>>`
    - [x] `bits shr` aka `shift --right` aka `>>`
    -bitwise shift right moves bits right

    - [ ] `bits rol` aka `rotate --left`
  4. fdncred revised this gist Aug 1, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    * https://github.com/niconii/twiddle
    * https://github.com/gnzlbg/bitwise

    - [ ] `bits shl` aka `shift --left` aka `<<`
    - [x] `bits shl` aka `shift --left` aka `<<`
    -bitwise shift left moves bits left

    - [ ] `bits shr` aka `shift --right` aka `>>`
  5. fdncred revised this gist Jul 30, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -74,7 +74,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - [x] `bits or` aka `|`
    - bitwise or performs logical or operation on each pair of bits

    - [ ] `bits xor` aka `^`
    - [x] `bits xor` aka `^`
    - bitwise xor perofrms logical exclusive or operation on each pair of bits

    - [x] `bits not` aka `~` aka `complement`
  6. fdncred revised this gist Jul 30, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -71,7 +71,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - [x] `bits and` aka `&`
    - bitwise and performas logical and operation on each pair of bits

    - [ ] `bits or` aka `|`
    - [x] `bits or` aka `|`
    - bitwise or performs logical or operation on each pair of bits

    - [ ] `bits xor` aka `^`
  7. fdncred revised this gist Jul 30, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -68,7 +68,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - [ ] `bits ror` aka `rotate --right`
    - bitwise shift right move a bit right and adds it to the left

    - [ ] `bits and` aka `&`
    - [x] `bits and` aka `&`
    - bitwise and performas logical and operation on each pair of bits

    - [ ] `bits or` aka `|`
  8. fdncred revised this gist Jul 30, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -77,7 +77,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - [ ] `bits xor` aka `^`
    - bitwise xor perofrms logical exclusive or operation on each pair of bits

    - [ ] `bits not` aka `~` aka `complement`
    - [x] `bits not` aka `~` aka `complement`
    - performs logical negation on each bit

    TBD - we could add later or make params or leave out and there are many more we could add
  9. fdncred revised this gist Jul 11, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - [x] `bytes ends-with`
    - returns bool of whether a buffer ends with specified byte(s)

    - [ ] `bytes find-replace` aka `bytes replace`
    - [x] `bytes find-replace` aka `bytes replace`
    - find and replace specified bytes

    - [x] `bytes add`
  10. fdncred revised this gist Jul 11, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -39,7 +39,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - [x] `bytes add`
    - add specified bytes to the --start, --end, --index

    - [ ] `bytes remove`
    - [x] `bytes remove`
    - remove specified bytes from --start, --end, --index

    - [x] `bytes reverse`
  11. fdncred revised this gist Jul 11, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - [x] `bytes size` aka `bytes length`
    - return the size of something in bytes

    - [ ] `bytes collect`
    - [x] `bytes collect`
    - collect bytes like str collect

    - [x] `bytes ends-with`
  12. fdncred revised this gist Jul 11, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - [x] `bytes to-str` - point to `decode utf-8`
    - returns specified bytes as a utf-8 string

    - [ ] `bytes build`
    - [x] `bytes build`
    - kind of like buildstring but for bytes

    - [x] `bytes size` aka `bytes length`
  13. fdncred revised this gist Jul 9, 2022. 1 changed file with 21 additions and 21 deletions.
    42 changes: 21 additions & 21 deletions bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -8,44 +8,44 @@ Commands specifically made for finding and manipulating binary data. Since namin
    * https://github.com/Mackirac/binary_byte
    * https://github.com/gmantaos/file-utils

    `bytes` query the bytes of a buffer
    - [x] `bytes` query the bytes of a buffer

    `bytes at` maybe thought of like `str sub-string`?
    - [x] `bytes at` maybe thought of like `str sub-string`?
    - returns the byte at a specified offset in decimal 10 or hex 0x10
    - returns the bytes in a range if specified like 1..10

    `bytes index-of` aka `bytes contains`
    - [x] `bytes index-of` aka `bytes contains`
    - finds the index of a specified hex byte 0x10
    - finds the index of a specified byte buffer

    `bytes to-str` - point to `decode utf-8`
    - [x] `bytes to-str` - point to `decode utf-8`
    - returns specified bytes as a utf-8 string

    `bytes build`
    - [ ] `bytes build`
    - kind of like buildstring but for bytes

    `bytes size` aka `bytes length`
    - [x] `bytes size` aka `bytes length`
    - return the size of something in bytes

    `bytes collect`
    - [ ] `bytes collect`
    - collect bytes like str collect

    `bytes ends-with`
    - [x] `bytes ends-with`
    - returns bool of whether a buffer ends with specified byte(s)

    `bytes find-replace` aka `bytes replace`
    - [ ] `bytes find-replace` aka `bytes replace`
    - find and replace specified bytes

    `bytes add`
    - [x] `bytes add`
    - add specified bytes to the --start, --end, --index

    `bytes remove`
    - [ ] `bytes remove`
    - remove specified bytes from --start, --end, --index

    `bytes reverse`
    - [x] `bytes reverse`
    - reverse a buffer of bytes

    `bytes starts-with`
    - [x] `bytes starts-with`
    - returns bool of whether a buffer starts with specified byte(s)

    # the `bits` command
    @@ -56,28 +56,28 @@ Commands specifically made for finding and manipulating binary data. Since namin
    * https://github.com/niconii/twiddle
    * https://github.com/gnzlbg/bitwise

    `bits shl` aka `shift --left` aka `<<`
    - [ ] `bits shl` aka `shift --left` aka `<<`
    -bitwise shift left moves bits left

    `bits shr` aka `shift --right` aka `>>`
    - [ ] `bits shr` aka `shift --right` aka `>>`
    -bitwise shift right moves bits right

    `bits rol` aka `rotate --left`
    - [ ] `bits rol` aka `rotate --left`
    - bitwise shift left move a bit left and adds it to the right

    `bits ror` aka `rotate --right`
    - [ ] `bits ror` aka `rotate --right`
    - bitwise shift right move a bit right and adds it to the left

    `bits and` aka `&`
    - [ ] `bits and` aka `&`
    - bitwise and performas logical and operation on each pair of bits

    `bits or` aka `|`
    - [ ] `bits or` aka `|`
    - bitwise or performs logical or operation on each pair of bits

    `bits xor` aka `^`
    - [ ] `bits xor` aka `^`
    - bitwise xor perofrms logical exclusive or operation on each pair of bits

    `bits not` aka `~` aka `complement`
    - [ ] `bits not` aka `~` aka `complement`
    - performs logical negation on each bit

    TBD - we could add later or make params or leave out and there are many more we could add
  14. fdncred revised this gist Jul 9, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@ Commands specifically made for finding and manipulating binary data. Since namin
    `bytes ends-with`
    - returns bool of whether a buffer ends with specified byte(s)

    `bytes find-replace`
    `bytes find-replace` aka `bytes replace`
    - find and replace specified bytes

    `bytes add`
  15. fdncred revised this gist Mar 18, 2022. 1 changed file with 0 additions and 177 deletions.
    177 changes: 0 additions & 177 deletions pattern_matching.md
    Original file line number Diff line number Diff line change
    @@ -1,177 +0,0 @@
    # Pattern Matching

    Some prior-art inspiration for an upcoming `match` command in nushell.

    ## Scala

    ```Scala
    import scala.util.Random

    val x: Int = Random.nextInt(10)

    x match {
    case 0 => "zero"
    case 1 => "one"
    case 2 => "two"
    case _ => "other"
    }
    ```

    ## Julia

    ```julia
    using Match

    @match item begin
    pattern1 => result1
    pattern2, if cond end => result2
    pattern3 || pattern4 => result3
    _ => default_result
    end
    ```

    ## ClojureScript

    ```clojure
    (ns foo.bar
    (:require [cljs.core.match :refer-macros [match]]))

    (doseq [n (range 1 101)]
    (println
    (match [(mod n 3) (mod n 5)]
    [0 0] "FizzBuzz"
    [0 _] "Fizz"
    [_ 0] "Buzz"
    :else n)))
    ```

    ## Elixir

    ```elixir
    iex> {a, b, c} = {:hello, "world", 42}
    {:hello, "world", 42}
    iex> a
    :hello
    iex> b
    "world"
    ```

    ## Haskell

    ```haskell
    bmiTell :: (RealFloat a) => a -> String
    bmiTell bmi
    | bmi <= 18.5 = "You're underweight, you emo, you!"
    | bmi <= 25.0 = "You're supposedly normal. Pffft, I bet you're ugly!"
    | bmi <= 30.0 = "You're fat! Lose some weight, fatty!"
    | otherwise = "You're a whale, congratulations!"
    ```

    ## Python

    ```python
    parser = argparse.ArgumentParser()
    parser.add_argument('command', choices=['push', 'pull', 'commit'])
    args = parser.parse_args()

    match args.command:
    case 'push':
    print('pushing')
    case 'pull':
    print('pulling')
    case _:
    parser.error(f'{args.command!r} not yet implemented')
    ```

    ## Elm

    ```elm
    toName : User -> String
    toName user =
    case user of
    Regular name age ->
    name

    Visitor name ->
    name

    -- toName (Regular "Thomas" 44) == "Thomas"
    -- toName (Visitor "kate95") == "kate95"
    ```

    ## F#

    ```fsharp
    type Color =
    | Red = 0
    | Green = 1
    | Blue = 2
    let printColorName (color:Color) =
    match color with
    | Color.Red -> printfn "Red"
    | Color.Green -> printfn "Green"
    | Color.Blue -> printfn "Blue"
    | _ -> ()
    printColorName Color.Red
    printColorName Color.Green
    printColorName Color.Blue
    ```

    ## Erlang

    ```erlang
    > N = {12, banana}.
    {12,banana}
    > {A, B} = N.
    {12,banana}
    > A.
    12
    > B.
    banana
    ```

    ## C#

    ```csharp
    string WaterState(int tempInFahrenheit) =>
    tempInFahrenheit switch
    {
    (> 32) and (< 212) => "liquid",
    < 32 => "solid",
    > 212 => "gas",
    32 => "solid/liquid transition",
    212 => "liquid / gas transition",
    };
    ```

    ## ReasonML

    ```reasonml
    switch (x) {
    | true => f("t")
    | false => g("f")
    };
    switch (x) {
    | "a" => 4.0
    | "tree" => 1.23
    | _ => 77.5
    };
    ```

    ## Swift

    ```swift
    let point = (1, 2)
    switch point {
    case (0, 0):
    print("(0, 0) is at the origin.")
    case (-2...2, -2...2):
    print("(\(point.0), \(point.1)) is near the origin.")
    default:
    print("The point is at (\(point.0), \(point.1)).")
    }
    // Prints "(1, 2) is near the origin."
    ```
  16. fdncred revised this gist Mar 18, 2022. 1 changed file with 177 additions and 1 deletion.
    178 changes: 177 additions & 1 deletion pattern_matching.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,177 @@
    ‎‎​
    # Pattern Matching

    Some prior-art inspiration for an upcoming `match` command in nushell.

    ## Scala

    ```Scala
    import scala.util.Random

    val x: Int = Random.nextInt(10)

    x match {
    case 0 => "zero"
    case 1 => "one"
    case 2 => "two"
    case _ => "other"
    }
    ```

    ## Julia

    ```julia
    using Match

    @match item begin
    pattern1 => result1
    pattern2, if cond end => result2
    pattern3 || pattern4 => result3
    _ => default_result
    end
    ```

    ## ClojureScript

    ```clojure
    (ns foo.bar
    (:require [cljs.core.match :refer-macros [match]]))

    (doseq [n (range 1 101)]
    (println
    (match [(mod n 3) (mod n 5)]
    [0 0] "FizzBuzz"
    [0 _] "Fizz"
    [_ 0] "Buzz"
    :else n)))
    ```

    ## Elixir

    ```elixir
    iex> {a, b, c} = {:hello, "world", 42}
    {:hello, "world", 42}
    iex> a
    :hello
    iex> b
    "world"
    ```

    ## Haskell

    ```haskell
    bmiTell :: (RealFloat a) => a -> String
    bmiTell bmi
    | bmi <= 18.5 = "You're underweight, you emo, you!"
    | bmi <= 25.0 = "You're supposedly normal. Pffft, I bet you're ugly!"
    | bmi <= 30.0 = "You're fat! Lose some weight, fatty!"
    | otherwise = "You're a whale, congratulations!"
    ```

    ## Python

    ```python
    parser = argparse.ArgumentParser()
    parser.add_argument('command', choices=['push', 'pull', 'commit'])
    args = parser.parse_args()

    match args.command:
    case 'push':
    print('pushing')
    case 'pull':
    print('pulling')
    case _:
    parser.error(f'{args.command!r} not yet implemented')
    ```

    ## Elm

    ```elm
    toName : User -> String
    toName user =
    case user of
    Regular name age ->
    name

    Visitor name ->
    name

    -- toName (Regular "Thomas" 44) == "Thomas"
    -- toName (Visitor "kate95") == "kate95"
    ```

    ## F#

    ```fsharp
    type Color =
    | Red = 0
    | Green = 1
    | Blue = 2
    let printColorName (color:Color) =
    match color with
    | Color.Red -> printfn "Red"
    | Color.Green -> printfn "Green"
    | Color.Blue -> printfn "Blue"
    | _ -> ()
    printColorName Color.Red
    printColorName Color.Green
    printColorName Color.Blue
    ```

    ## Erlang

    ```erlang
    > N = {12, banana}.
    {12,banana}
    > {A, B} = N.
    {12,banana}
    > A.
    12
    > B.
    banana
    ```

    ## C#

    ```csharp
    string WaterState(int tempInFahrenheit) =>
    tempInFahrenheit switch
    {
    (> 32) and (< 212) => "liquid",
    < 32 => "solid",
    > 212 => "gas",
    32 => "solid/liquid transition",
    212 => "liquid / gas transition",
    };
    ```

    ## ReasonML

    ```reasonml
    switch (x) {
    | true => f("t")
    | false => g("f")
    };
    switch (x) {
    | "a" => 4.0
    | "tree" => 1.23
    | _ => 77.5
    };
    ```

    ## Swift

    ```swift
    let point = (1, 2)
    switch point {
    case (0, 0):
    print("(0, 0) is at the origin.")
    case (-2...2, -2...2):
    print("(\(point.0), \(point.1)) is near the origin.")
    default:
    print("The point is at (\(point.0), \(point.1)).")
    }
    // Prints "(1, 2) is near the origin."
    ```
  17. fdncred revised this gist Mar 18, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions pattern_matching.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ‎‎​
  18. fdncred revised this gist Feb 14, 2022. 1 changed file with 9 additions and 8 deletions.
    17 changes: 9 additions & 8 deletions bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    Commands specifically made for finding and manipulating binary data. Since naming is hard, we may end up changing the name. :)

    # the `bytes` command
    ### crates for bytes
    ### potential crates for bytes
    * https://docs.rs/bytes/latest/bytes/
    * https://github.com/cronosun/abin/
    * https://github.com/Mackirac/binary_byte
    @@ -50,7 +50,7 @@ Commands specifically made for finding and manipulating binary data. Since namin

    # the `bits` command

    ### crates for bits
    ### protentional crates for bits
    * https://github.com/kkayal/bitlab
    * https://github.com/RustyNixieTube/bit_op
    * https://github.com/niconii/twiddle
    @@ -81,10 +81,11 @@ Commands specifically made for finding and manipulating binary data. Since namin
    - performs logical negation on each bit

    TBD - we could add later or make params or leave out and there are many more we could add
    `sal` - shift arithmatic left
    `sar` - shift arithmatic right
    `rcl` - rotate carry left
    `rcr` - rotate carry right
    `shld` - shift left number of bits
    `shrd` - shift right number of bits

    * `sal` - shift arithmatic left
    * `sar` - shift arithmatic right
    * `rcl` - rotate carry left
    * `rcr` - rotate carry right
    * `shld` - shift left number of bits
    * `shrd` - shift right number of bits

  19. fdncred revised this gist Feb 11, 2022. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -79,3 +79,12 @@ Commands specifically made for finding and manipulating binary data. Since namin

    `bits not` aka `~` aka `complement`
    - performs logical negation on each bit

    TBD - we could add later or make params or leave out and there are many more we could add
    `sal` - shift arithmatic left
    `sar` - shift arithmatic right
    `rcl` - rotate carry left
    `rcr` - rotate carry right
    `shld` - shift left number of bits
    `shrd` - shift right number of bits

  20. fdncred revised this gist Feb 11, 2022. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -56,16 +56,16 @@ Commands specifically made for finding and manipulating binary data. Since namin
    * https://github.com/niconii/twiddle
    * https://github.com/gnzlbg/bitwise

    `bits shift --left` aka `<<`
    `bits shl` aka `shift --left` aka `<<`
    -bitwise shift left moves bits left

    `bits shift --right` aka `>>`
    `bits shr` aka `shift --right` aka `>>`
    -bitwise shift right moves bits right

    `bits rotate --left`
    `bits rol` aka `rotate --left`
    - bitwise shift left move a bit left and adds it to the right

    `bits rotate --right`
    `bits ror` aka `rotate --right`
    - bitwise shift right move a bit right and adds it to the left

    `bits and` aka `&`
  21. fdncred revised this gist Feb 10, 2022. 1 changed file with 81 additions and 1 deletion.
    82 changes: 81 additions & 1 deletion bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,81 @@
    ‎‎​
    # Introducing the `bytes` and the `bits` command.
    Commands specifically made for finding and manipulating binary data. Since naming is hard, we may end up changing the name. :)

    # the `bytes` command
    ### crates for bytes
    * https://docs.rs/bytes/latest/bytes/
    * https://github.com/cronosun/abin/
    * https://github.com/Mackirac/binary_byte
    * https://github.com/gmantaos/file-utils

    `bytes` query the bytes of a buffer

    `bytes at` maybe thought of like `str sub-string`?
    - returns the byte at a specified offset in decimal 10 or hex 0x10
    - returns the bytes in a range if specified like 1..10

    `bytes index-of` aka `bytes contains`
    - finds the index of a specified hex byte 0x10
    - finds the index of a specified byte buffer

    `bytes to-str` - point to `decode utf-8`
    - returns specified bytes as a utf-8 string

    `bytes build`
    - kind of like buildstring but for bytes

    `bytes size` aka `bytes length`
    - return the size of something in bytes

    `bytes collect`
    - collect bytes like str collect

    `bytes ends-with`
    - returns bool of whether a buffer ends with specified byte(s)

    `bytes find-replace`
    - find and replace specified bytes

    `bytes add`
    - add specified bytes to the --start, --end, --index

    `bytes remove`
    - remove specified bytes from --start, --end, --index

    `bytes reverse`
    - reverse a buffer of bytes

    `bytes starts-with`
    - returns bool of whether a buffer starts with specified byte(s)

    # the `bits` command

    ### crates for bits
    * https://github.com/kkayal/bitlab
    * https://github.com/RustyNixieTube/bit_op
    * https://github.com/niconii/twiddle
    * https://github.com/gnzlbg/bitwise

    `bits shift --left` aka `<<`
    -bitwise shift left moves bits left

    `bits shift --right` aka `>>`
    -bitwise shift right moves bits right

    `bits rotate --left`
    - bitwise shift left move a bit left and adds it to the right

    `bits rotate --right`
    - bitwise shift right move a bit right and adds it to the left

    `bits and` aka `&`
    - bitwise and performas logical and operation on each pair of bits

    `bits or` aka `|`
    - bitwise or performs logical or operation on each pair of bits

    `bits xor` aka `^`
    - bitwise xor perofrms logical exclusive or operation on each pair of bits

    `bits not` aka `~` aka `complement`
    - performs logical negation on each bit
  22. fdncred created this gist Feb 10, 2022.
    1 change: 1 addition & 0 deletions bytes_and_bits.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ‎‎​