EncodingUtils
Keywords: net.corda.core.utilities.EncodingUtils class
Date: 2023-09-18

net.corda.core.utilities

## Class EncodingUtils

- net.corda.core.utilities.EncodingUtils

-     public class EncodingUtils

- - ### Field Detail

    - #### MAX_HASH_HEX_SIZE

          public static int MAX_HASH_HEX_SIZE

      The maximum supported field-size for hash HEX-encoded outputs (e.g. database fields). This value is enough to support hash functions with outputs up to 512 bits (e.g. SHA3-512), in which case 128 HEX characters are required. 130 was selected instead of 128, to allow for 2 extra characters that will be used as hash-scheme identifiers.

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EncodingUtils

          public EncodingUtils()

  - ### Method Detail

    - #### toBase58

          @NotNull
          public static java.lang.String toBase58(@NotNull
                                                           kotlin.Array[] $this$toBase58)

      Convert a byte array to a Base58 encoded String.

      See Also:
        String

    - #### toBase64

          @NotNull
          public static java.lang.String toBase64(@NotNull
                                                           kotlin.Array[] $this$toBase64)

      Convert a byte array to a Base64 encoded String.

      See Also:
        String

    - #### toHex

          @NotNull
          public static java.lang.String toHex(@NotNull
                                                        kotlin.Array[] $this$toHex)

      Convert a byte array to a hex (Base16) capitalized encoded String.

      See Also:
        String

    - #### base58ToRealString

          @NotNull
          public static java.lang.String base58ToRealString(@NotNull
                                                                     java.lang.String $this$base58ToRealString)

      Base58-String to the actual real String, i.e. "JxF12TrwUP45BMd" -> "Hello World".

      See Also:
        String

    - #### base64ToRealString

          @NotNull
          public static java.lang.String base64ToRealString(@NotNull
                                                                     java.lang.String $this$base64ToRealString)

      Base64-String to the actual real String, i.e. "SGVsbG8gV29ybGQ=" -> "Hello World".

      See Also:
        String

    - #### hexToRealString

          @NotNull
          public static java.lang.String hexToRealString(@NotNull
                                                                  java.lang.String $this$hexToRealString)

      HEX-String to the actual real String, i.e. "48656C6C6F20576F726C64" -> "Hello World".

      See Also:
        String

    - #### base58ToByteArray

          @NotNull
          public static kotlin.Array[] base58ToByteArray(@NotNull
                                                                  java.lang.String $this$base58ToByteArray)

    - #### base64ToByteArray

          @NotNull
          public static kotlin.Array[] base64ToByteArray(@NotNull
                                                                  java.lang.String $this$base64ToByteArray)

    - #### hexToByteArray

          @NotNull
          public static kotlin.Array[] hexToByteArray(@NotNull
                                                               java.lang.String $this$hexToByteArray)

      Hex-String to ByteArray. Accept any hex form (capitalized, lowercase, mixed).

      See Also:
        ByteArray

    - #### base58toBase64

          @NotNull
          public static java.lang.String base58toBase64(@NotNull
                                                                 java.lang.String $this$base58toBase64)

      Encoding changer. Base58-String to Base64-String, i.e. "SGVsbG8gV29ybGQ=" -> JxF12TrwUP45BMd"

      See Also:
        String, String

    - #### base58toHex

          @NotNull
          public static java.lang.String base58toHex(@NotNull
                                                              java.lang.String $this$base58toHex)

      Encoding changer. Base58-String to Hex-String, i.e. "SGVsbG8gV29ybGQ=" -> "48656C6C6F20576F726C64"

      See Also:
        String, String

    - #### base64toBase58

          @NotNull
          public static java.lang.String base64toBase58(@NotNull
                                                                 java.lang.String $this$base64toBase58)

      Encoding changer. Base64-String to Base58-String, i.e. "SGVsbG8gV29ybGQ=" -> JxF12TrwUP45BMd"

      See Also:
        String, String

    - #### base64toHex

          @NotNull
          public static java.lang.String base64toHex(@NotNull
                                                              java.lang.String $this$base64toHex)

      Encoding changer. Base64-String to Hex-String, i.e. "SGVsbG8gV29ybGQ=" -> "48656C6C6F20576F726C64"

      See Also:
        String, String

    - #### hexToBase58

          @NotNull
          public static java.lang.String hexToBase58(@NotNull
                                                              java.lang.String $this$hexToBase58)

      Encoding changer. Hex-String to Base58-String, i.e. "48656C6C6F20576F726C64" -> "JxF12TrwUP45BMd"

      See Also:
        String, String

    - #### hexToBase64

          @NotNull
          public static java.lang.String hexToBase64(@NotNull
                                                              java.lang.String $this$hexToBase64)

      Encoding changer. Hex-String to Base64-String, i.e. "48656C6C6F20576F726C64" -> "SGVsbG8gV29ybGQ="

      See Also:
        String, String

    - #### parsePublicKeyBase58

          @NotNull
          public static java.security.PublicKey parsePublicKeyBase58(@NotNull
                                                                              java.lang.String base58String)

      Method to return the PublicKey object given its Base58-String representation.

      Parameters:
        `base58String` - the Base58 encoded format of the serialised PublicKey.
      Returns:
        the resulted PublicKey after decoding the `base58String` input and then deserialising to a PublicKey object.
      See Also:
        PublicKey, String

    - #### toBase58String

          @NotNull
          public static java.lang.String toBase58String(@NotNull
                                                                 java.security.PublicKey $this$toBase58String)

      Return the Base58 representation of the serialised public key.

    - #### toSHA256Bytes

          @NotNull
          public static kotlin.Array[] toSHA256Bytes(@NotNull
                                                              java.security.PublicKey $this$toSHA256Bytes)

      Return the bytes of the SHA-256 output for this public key.