agave-common/common-core/src/main/java/org/iplantc/service/common/auth/MyProxy.java
/**
     * Encode binary to hex
     * @param bin byte array to encode
     * @return
     */
Encode binary to hex
@param bin byte array to encode
@return
Encode binary to hex @param bin byte array to encode @return
private static String toHex(final byte[] bin) {
        if (bin == null || bin.length == 0)
            return "";
        char[] buffer = new char[bin.length * 2];
        final char[] hex = "0123456789abcdef".toCharArray();
        for (int i = 0, j = 0; i < bin.length; i++)
        {
            final byte b = bin[i];
            buffer[j++] = hex[(b >> 4) & 0x0F];
            buffer[j++] = hex[b & 0x0F];
        }
        return new String(buffer);
    }
private static String toHex ( final byte [ ] bin ) { if ( bin == null || bin . length == 0 ) return "" ; char [ ] buffer = new char [ bin . length * 2 ] ; final char [ ] hex = "0123456789abcdef" . toCharArray ( ) ; for ( int i = 0 , j = 0 ; i < bin . length ; i ++ ) { final byte b = bin [ i ] ; buffer [ j ++ ] = hex [ ( b >> 4 ) & 0x0F ] ; buffer [ j ++ ] = hex [ b & 0x0F ] ; } return new String ( buffer ) ; }
Encode binary to hex
 @param bin byte array to encode
 @return
Encode binary to hex @param bin byte array to encode @return
// i tracks input position, j tracks output position