Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 18.190.152.109
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/phpmyadmin/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/phpmyadmin/js/big_ints.js
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * phpMyAdmin's BigInts library
 */

/**
 * @var BigInts object to handle big integers (in string)
 *      as JS can handle upto 53 bits of precision only.
 */
var BigInts = {

    /**
     * Compares two integer strings
     *
     * @param int1 the string representation of 1st integer
     * @param int2 the string representation of 2nd integer
     *
     * @return int 0 if equal, < 0 if int1 < int2, else > 0
     */
    compare: function(int1, int2) {
        // trim integers
        int1 = int1.trim();
        int2 = int2.trim();
        // length of integer strings
        var len1 = int1.length;
        var len2 = int2.length;
        // integer is -ve or not
        var isNeg1 = (int1[0] === '-');
        var isNeg2 = (int2[0] === '-');
        // Sign of int1 != int2 then no actual comparison
        // is needed we can return result directly
        if (isNeg1 !== isNeg2) {
            return (isNeg1 === true ? -1 : 1);
        }
        // replace - sign with 0
        int1[0] = isNeg1 ? '0' : int1[0];
        int2[0] = isNeg2 ? '0' : int2[0];
        // pad integers with 0 to make them
        // equal length
        int1 = BigInts.lpad(int1, len2);
        int2 = BigInts.lpad(int2, len1);
        // Now they are good to compare as strings
        if (int1 !== int2) {
            return (int1 < int2 ? -1 : 1);
        }
        return 0;
    },

    /**
     * Adds leading zeros to a integer given a total length
     *
     * @param int   the string representation of the integer
     * @param total the total length required
     *
     * @return int the integer of length given with added leading
     *             zeros if necessary
     */
    lpad: function(int, total){
        var len = int.length;
        var pad = '';
        while(len < total) {
            pad += '0';
            len++;
        }
        return (pad + int);
    }
};

Anon7 - 2022
AnonSec Team