Enum Base32

    • Method Detail

      • values

        public static Base32[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Base32 c : Base32.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Base32 valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • encodeAsString

        public static String encodeAsString​(byte... bytes)
        Returns a base 32 encoded string of the given bytes.
      • encode

        public static byte[] encode​(byte[] bytes)
        Returns a 32 encoded byte array of the given bytes.
      • decode

        public static byte[] decode​(String b32)
        Decodes the given base 32 encoded string, skipping carriage returns, line feeds and spaces as needed.
      • decode

        public static byte[] decode​(byte[] b32)
        Decodes the given base 32 encoded bytes.