Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,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,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/wwwroot/mifepriston.org/node_modules/hash-sum/ |
Upload File : |
'use strict'; var _ = require('lodash'); var test = require('tape'); var sum = require('./'); test('creates unique hashes', function (t) { var results = []; sub([0,1,2,3]); sub({url:12}); sub({headers:12}); sub({headers:122}); sub({headers:'122'}); sub({headers:{accept:'text/plain'}}); sub({payload:[0,1,2,3],headers:[{a:'b'}]}); sub({a:function () {}}); sub({b:function () {}}); sub({b:function (a) {}}); sub(function () {}); sub(function (a) {}); sub(function (b) {}); sub(function (a) { return a;}); sub(function (a) {return a;}); sub(''); sub('null'); sub('false'); sub('true'); sub('0'); sub('1'); sub('void 0'); sub('undefined'); sub(null); sub(false); sub(true); sub(0); sub(1); sub(void 0); sub({}); sub({a:{},b:{}}); sub([]); sub(new Date()); sub(global, 'global'); t.equal(results.length, _.uniq(results).length); t.end(); function sub (value, name) { var hash = sum(value); results.push(hash); console.log('%s from:', hash, name || value); } }); test('hashes clash if same properties', function (t) { equals({a:'1'},{a:'1'}); equals({a:'1',b:1},{b:1,a:'1'}); t.end(); function equals (a, b) { t.equal(sum(a), sum(b)); } });