Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary strings #2736

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Commits on Jul 26, 2023

  1. Add binary string functionality

    This commit adds `tobinary/0`, which converts a normal string (or an
    array of bytes, flattened) to a binary string that will be
    base64-encoded on output.  The string will remain unencoded during the
    execution of the jq program -- encoding is not applied until the string
    is to be output, or until `tostring` is applied.
    
    Also added is an `encodeas/1` that takes a string argument of
    `"base64"`, `"hex"`, `"bytearray"`, or `"UTF-8"` and outputs its input
    altered so that on output the string will be encoded in base64, hex, as
    an array of bytes, or be converted to UTF-8 by applying UTF-8 validation
    and bad character mapping.
    
    As well, there is a `tobinary/1` that converts a stream of strings,
    numeric unsigned byte values, and arrays of bytes, to a binary.
    
    As well there is a `isbinary/0` which indicates whether the input is
    binary.
    
    As well there is a `stringtype/0` which indicates whether a string is
    binary or UTF-8.
    
    As well there is a `encoding/0` which indicates the output encoding of
    the input.
    nicowilliams committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    253dc6f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3f61e23 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3590d6c View commit details
    Browse the repository at this point in the history
  4. Fix build error

    nicowilliams committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    daff7b0 View commit details
    Browse the repository at this point in the history
  5. Fix docs

    nicowilliams committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    8880187 View commit details
    Browse the repository at this point in the history