• Canonicalizes a given object according to RFC 8785 (https://tools.ietf.org/html/rfc8785), which describes JSON Canonicalization Scheme (JCS). This function sorts the keys of the object and its nested objects alphabetically and then returns a stringified version of it. This method handles nested objects, array values, and null values appropriately.

    Parameters

    • obj: {
          [key: string]: any;
      }

      The object to canonicalize.

      • [key: string]: any

    Returns string

    The stringified version of the input object with its keys sorted alphabetically per RFC 8785.