@Immutable
    public static String bin2hex(Memory _value) {
        String value = _value.toBinaryString();
        StringBuilder sb = new StringBuilder();

        int ch;
        int length = value.length();
        for (int i = 0; i < length; i++) {
            ch = value.charAt(i);
            int d = (ch >> 4) & 0xf;

            if (d < 10)
                sb.append((char) (d + '0'));
            else
                sb.append((char) (d + 'a' - 10));

            d = (ch) & 0xf;

            if (d < 10)
                sb.append((char) (d + '0'));
            else
                sb.append((char) (d + 'a' - 10));
        }

        return sb.toString();
    }
Parses the cslashes bitmap returning an actual bitmap.

@param charset the bitmap string

@return the actual bitmap
exts/jphp-zend-ext/src/main/java/org/develnext/jphp/zend/ext/standard/StringFunctions.java