|
From: <wis...@us...> - 2014-12-11 13:20:12
|
Revision: 12900
http://sourceforge.net/p/xoops/svn/12900
Author: wishcraft
Date: 2014-12-11 13:19:58 +0000 (Thu, 11 Dec 2014)
Log Message:
-----------
Subjected API for Conversion to XoopsAPI -- Xoops 2.x
Added Paths:
-----------
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/index.html
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.base.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.class.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.enumerator.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.leaver.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp64/
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp64/index.html
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp64/qcp64.base.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp64/qcp64.class.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp64/qcp64.enumerator.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp64/qcp64.leaver.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp64/qcp64.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp71/
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp71/index.html
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp71/qcp71.base.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp71/qcp71.class.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp71/qcp71.enumerator.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp71/qcp71.leaver.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp71/qcp71.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/xoopscrc/
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/xoopscrc/index.html
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/xoopscrc/xoops.crc.base.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/xoopscrc/xoops.crc.class.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/xoopscrc/xoops.crc.enumerator.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/xoopscrc/xoops.crc.leaver.php
ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/xoopscrc/xoopscrc.php
Added: ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/index.html
===================================================================
--- ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/index.html (rev 0)
+++ ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/index.html 2014-12-11 13:19:58 UTC (rev 12900)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.base.php
===================================================================
--- ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.base.php (rev 0)
+++ ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.base.php 2014-12-11 13:19:58 UTC (rev 12900)
@@ -0,0 +1,553 @@
+<?php
+// $Id: qcp135.base.php 1.1.0 - QCP135 2008-08-15 9:22:20 wishcraft $
+// ------------------------------------------------------------------------ //
+// CLORA - Chronolabs Australia //
+// Copyright (c) 2008 //
+// <http://www.chronolabs.org.au/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the SDPL Source Directive Public Licence //
+// as published by Chronolabs Australia; either version 2 of the License, //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Chronolab Australia //
+// Chronolabs International PO BOX 699, DULWICH HILL, NSW, 2203, Australia //
+// ------------------------------------------------------------------------ //
+
+if (!class_exists('qcp135_base'))
+{
+ // error_reporting(0);
+
+ class qcp135_base extends qcp135
+ {
+
+ var $base;
+ var $seed;
+ var $mode;
+ var $roll;
+ var $num_evr;
+
+ function __construct ($seed = 127)
+ {
+ if ($seed<1)
+ {
+ $this->seed = 1;
+ } elseif ($seed>255) {
+ $this->seed = 256;
+ } else {
+ $this->seed = $seed;
+ }
+ $base = $this->_set_base();
+ return $this->get_base();
+ }
+
+ private function _set_base()
+ {
+
+ if ($this->seed < 65)
+ {
+ $case=true;
+ } else {
+ $case=false;
+ }
+
+ $this->roll = ($this->seed / (3+(1/6)));
+ $this->num_evr = floor((34.32 / ($this->roll/$this->seed))/($this->seed*($this->roll/17.8)));
+
+ if ($this->roll<16)
+ {
+ $this->mode = '1';
+ } elseif ($this->roll >15 && $this->roll<32) {
+ $this->mode = '2';
+ } elseif ($this->roll >32 && $this->roll<48) {
+ $this->mode = '3';
+ } elseif ($this->roll >48 ) {
+ $this->mode = '4';
+ }
+
+ if ($this->num_evr==0)
+ {
+ $this->num_evr = floor((($this->seed/$this->mode)/($this->mode*3.015)));
+ } elseif ($this->num_evr>8) {
+ $this->num_evr = $this->num_evr - floor($this->mode*1.35);
+ }
+
+
+
+ $this->base = array();
+ switch ($this->mode){
+ case 1:
+ $ii = 0;
+ $num = 0;
+ $letter = "a";
+ for ($qcb=1;$qcb<32;$qcb++)
+ {
+ $ii++;
+ $done = false;
+ if ($sofar == $this->num_evr)
+ {
+ if ($num < 9)
+ {
+ $this->base[$qcb] = $num;
+ $num++;
+ $sofar = 0;
+ $done = true;
+ }
+ } else {
+ $sofar++;
+ }
+
+ if ($done == false)
+ {
+ if (floor($qcb / ($this->roll/$this->num_evr))>$this->mode)
+ {
+ switch ($case)
+ {
+ case true:
+ $this->base[$qcb] = $letter;
+ break;
+ case false:
+ $this->base[$qcb] = strtoupper($letter);
+ break;
+ }
+ } else {
+ $this->base[$qcb] = $letter;
+ }
+ $letter++;
+ if (strlen($letter++)>1) { $letter="a"; }
+ }
+ }
+
+ for ($qcb=64;$qcb>31;$qcb--)
+ {
+ $ii++;
+ $done = false;
+ if ($sofar == $this->num_evr)
+ {
+ if ($num < 9)
+ {
+ $this->base[$qcb] = $num;
+ $num++;
+ $sofar = 0;
+ $done = true;
+ }
+ } else {
+ $sofar++;
+ }
+
+ if ($done == false)
+ {
+ if (floor($qcb / ($this->roll/$this->num_evr))>$this->mode)
+ {
+ switch ($case)
+ {
+ case true:
+ $this->base[$qcb] = $letter;
+ break;
+ case false:
+ $this->base[$qcb] = strtoupper($letter);
+ break;
+ }
+ } else {
+ $this->base[$qcb] = $letter;
+ }
+ $letter++;
+ if (strlen($letter++)>1) { $letter="a"; }
+ }
+ }
+ break;
+ case 2:
+ $ii = 0;
+ $num = 0;
+ $letter = "a";
+ for ($qcb=32;$qcb>0;$qcb--)
+ {
+ $ii++;
+ $done = false;
+ if ($sofar == $this->num_evr)
+ {
+ if ($num < 9)
+ {
+ $this->base[$qcb] = $num;
+ $num++;
+ $sofar = 0;
+ $done = true;
+ }
+ } else {
+ $sofar++;
+ }
+
+ if ($done == false)
+ {
+ if (floor($qcb / ($this->roll/$this->num_evr))>$this->mode)
+ {
+ switch ($case)
+ {
+ case true:
+ $this->base[$qcb] = $letter;
+ break;
+ case false:
+ $this->base[$qcb] = strtoupper($letter);
+ break;
+ }
+ } else {
+ $this->base[$qcb] = $letter;
+ }
+ $letter++;
+ if (strlen($letter++)>1) { $letter="a"; }
+ }
+ }
+
+ for ($qcb=32;$qcb<65;$qcb++)
+ {
+ $ii++;
+ $done = false;
+ if ($sofar == $this->num_evr)
+ {
+ if ($num < 9)
+ {
+ $this->base[$qcb] = $num;
+ $num++;
+ $sofar = 0;
+ $done = true;
+ }
+ } else {
+ $sofar++;
+ }
+
+ if ($done == false)
+ {
+ if (floor($qcb / ($this->roll/$this->num_evr))>$this->mode)
+ {
+ switch ($case)
+ {
+ case true:
+ $this->base[$qcb] = $letter;
+ break;
+ case false:
+ $this->base[$qcb] = strtoupper($letter);
+ break;
+ }
+ } else {
+ $this->base[$qcb] = $letter;
+ }
+ $letter++;
+ if (strlen($letter++)>1) { $letter="a"; }
+ }
+ }
+ break;
+ case 3:
+ $ii = 0;
+ $num = 0;
+ $letter = "a";
+ for ($qcb=1;$qcb<17;$qcb++)
+ {
+ $ii++;
+ $done = false;
+ if ($sofar == $this->num_evr)
+ {
+ if ($num < 9)
+ {
+ $this->base[$qcb] = $num;
+ $num++;
+ $sofar = 0;
+ $done = true;
+ }
+ } else {
+ $sofar++;
+ }
+
+ if ($done == false)
+ {
+ if (floor($qcb / ($this->roll/$this->num_evr))>$this->mode)
+ {
+ switch ($case)
+ {
+ case true:
+ $this->base[$qcb] = $letter;
+ break;
+ case false:
+ $this->base[$qcb] = strtoupper($letter);
+ break;
+ }
+ } else {
+ $this->base[$qcb] = $letter;
+ }
+ $letter++;
+ if (strlen($letter++)>1) { $letter="a"; }
+ }
+ }
+
+ for ($qcb=64;$qcb>47;$qcb--)
+ {
+ $ii++;
+ $done = false;
+ if ($sofar == $this->num_evr)
+ {
+ if ($num < 9)
+ {
+ $this->base[$qcb] = $num;
+ $num++;
+ $sofar = 0;
+ $done = true;
+ }
+ } else {
+ $sofar++;
+ }
+
+ if ($done == false)
+ {
+ if (floor($qcb / ($this->roll/$this->num_evr))>$this->mode)
+ {
+ switch ($case)
+ {
+ case true:
+ $this->base[$qcb] = $letter;
+ break;
+ case false:
+ $this->base[$qcb] = strtoupper($letter);
+ break;
+ }
+ } else {
+ $this->base[$qcb] = $letter;
+ }
+ $letter++;
+ if (strlen($letter++)>1) { $letter="a"; }
+ }
+ }
+
+ for ($qcb=32;$qcb>16;$qcb--)
+ {
+ $ii++;
+ $done = false;
+ if ($sofar == $this->num_evr)
+ {
+ if ($num < 9)
+ {
+ $this->base[$qcb] = $num;
+ $num++;
+ $sofar = 0;
+ $done = true;
+ }
+ } else {
+ $sofar++;
+ }
+
+ if ($done == false)
+ {
+ if (floor($qcb / ($this->roll/$this->num_evr))>$this->mode)
+ {
+ switch ($case)
+ {
+ case true:
+ $this->base[$qcb] = $letter;
+ break;
+ case false:
+ $this->base[$qcb] = strtoupper($letter);
+ break;
+ }
+ } else {
+ $this->base[$qcb] = $letter;
+ }
+ $letter++;
+ if (strlen($letter++)>1) { $letter="a"; }
+ }
+ }
+
+
+ for ($qcb=32;$qcb<48;$qcb++)
+ {
+ $ii++;
+ $done = false;
+ if ($sofar == $this->num_evr)
+ {
+ if ($num < 9)
+ {
+ $this->base[$qcb] = $num;
+ $num++;
+ $sofar = 0;
+ $done = true;
+ }
+ } else {
+ $sofar++;
+ }
+
+ if ($done == false)
+ {
+ if (floor($qcb / ($this->roll/$this->num_evr))>$this->mode)
+ {
+ switch ($case)
+ {
+ case true:
+ $this->base[$qcb] = $letter;
+ break;
+ case false:
+ $this->base[$qcb] = strtoupper($letter);
+ break;
+ }
+ } else {
+ $this->base[$qcb] = $letter;
+ }
+ $letter++;
+ if (strlen($letter++)>1) { $letter="a"; }
+ }
+ }
+ break;
+ case 4:
+ $ii = 0;
+ $num = 0;
+ $letter = "a";
+
+ for ($qcb=17;$qcb>0;$qcb--)
+ {
+ $ii++;
+ $done = false;
+ if ($sofar == $this->num_evr)
+ {
+ if ($num < 9)
+ {
+ $this->base[$qcb] = $num;
+ $num++;
+ $sofar = 0;
+ $done = true;
+ }
+ } else {
+ $sofar++;
+ }
+
+ if ($done == false)
+ {
+ if (floor($qcb / ($this->roll/$this->num_evr))>$this->mode)
+ {
+ switch ($case)
+ {
+ case true:
+ $this->base[$qcb] = $letter;
+ break;
+ case false:
+ $this->base[$qcb] = strtoupper($letter);
+ break;
+ }
+ } else {
+ $this->base[$qcb] = $letter;
+ }
+ $letter++;
+ if (strlen($letter++)>1) { $letter="a"; }
+ }
+ }
+
+ for ($qcb=17;$qcb<49;$qcb++)
+ {
+ $ii++;
+ $done = false;
+ if ($sofar == $this->num_evr)
+ {
+ if ($num < 9)
+ {
+ $this->base[$qcb] = $num;
+ $num++;
+ $sofar = 0;
+ $done = true;
+ }
+ } else {
+ $sofar++;
+ }
+
+ if ($done == false)
+ {
+ if (floor($qcb / ($this->roll/$this->num_evr))>$this->mode)
+ {
+ switch ($case)
+ {
+ case true:
+ $this->base[$qcb] = $letter;
+ break;
+ case false:
+ $this->base[$qcb] = strtoupper($letter);
+ break;
+ }
+ } else {
+ $this->base[$qcb] = $letter;
+ }
+ $letter++;
+ if (strlen($letter++)>1) { $letter="a"; }
+ }
+ }
+
+ for ($qcb=64;$qcb>48;$qcb--)
+ {
+ $ii++;
+ $done = false;
+ if ($sofar == $this->num_evr)
+ {
+ if ($num < 9)
+ {
+ $this->base[$qcb] = $num;
+ $num++;
+ $sofar = 0;
+ $done = true;
+ }
+ } else {
+ $sofar++;
+ }
+
+ if ($done == false)
+ {
+ if (floor($qcb / ($this->roll/$this->num_evr))>$this->mode)
+ {
+ switch ($case)
+ {
+ case true:
+ $this->base[$qcb] = $letter;
+ break;
+ case false:
+ $this->base[$qcb] = strtoupper($letter);
+ break;
+ }
+ } else {
+ $this->base[$qcb] = $letter;
+ }
+ $letter++;
+ if (strlen($letter++)>1) { $letter="a"; }
+ }
+ }
+ break;
+ }
+ }
+
+ function get_base()
+ {
+ return $this->base;
+
+ }
+
+ function debug_base()
+ {
+ $base = array();
+ foreach ($this->base as $key => $data)
+ {
+ $base[$key] = array("char" => $data,
+ "ord" => ord($data),
+ "bin" => decbin(ord($data)));
+ }
+
+ return array("mode" => $this->mode, "roll" => $this->roll,
+ "seed" => $this->seed, "mode" => $this->mode,
+ "num_evr" => $this->num_evr, "base" => $this->base,
+ "debug" => $base);
+ }
+ }
+}
+
+?>
\ No newline at end of file
Added: ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.class.php
===================================================================
--- ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.class.php (rev 0)
+++ ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.class.php 2014-12-11 13:19:58 UTC (rev 12900)
@@ -0,0 +1,75 @@
+<?php
+// $Id: qcp135.class.php 1.1.0 - QCP135 2008-08-15 9:22:20 wishcraft $
+// ------------------------------------------------------------------------ //
+// CLORA - Chronolabs Australia //
+// Copyright (c) 2008 //
+// <http://www.chronolabs.org.au/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the SDPL Source Directive Public Licence //
+// as published by Chronolabs Australia; either version 2 of the License, //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Chronolab Australia //
+// Chronolabs International PO BOX 699, DULWICH HILL, NSW, 2203, Australia //
+// ------------------------------------------------------------------------ //
+
+if (!class_exists('qcp135'))
+{
+
+ // error_reporting(E_ERROR);
+
+ class qcp135
+ {
+ var $base;
+ var $enum;
+ var $seed;
+ var $crc;
+
+ function __construct($data, $seed, $len=29)
+ {
+ $this->seed = $seed;
+ $this->length = $len;
+ $this->base = new qcp135_base((int)$seed);
+ $this->enum = new qcp135_enumerator($this->base);
+
+ if (!empty($data))
+ {
+ for ($i=1; $i<strlen($data); $i++)
+ {
+ $enum_calc = $this->enum->enum_calc(substr($data,$i,1),$enum_calc);
+ }
+ $qcp135_crc = new qcp135_leaver($enum_calc, $this->base, $this->length);
+ $this->crc = $qcp135_crc->crc;
+ }
+
+ }
+
+ function calc($data)
+ {
+ for ($i=1; $i<strlen($data); $i++)
+ {
+ $enum_calc = $this->enum->enum_calc(substr($data,$i,1),$enum_calc);
+ }
+ $qcp135_crc = new qcp135_leaver($enum_calc, $this->base, $this->length);
+ return $qcp135_crc->crc;
+ }
+ }
+}
+
+require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'qcp135.base.php');
+require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'qcp135.enumerator.php');
+require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'qcp135.leaver.php');
+
+
Added: ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.enumerator.php
===================================================================
--- ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.enumerator.php (rev 0)
+++ ThirdParty/api/labs.coop/v1.1/*/hashing/public_html/hashes/qcp135/qcp135.enumerator.php 2014-12-11 13:19:58 UTC (rev 12900)
@@ -0,0 +1,325 @@
+<?php
+// $Id: qcp135.enumerator.php 1.1.0 - QCP135 2008-08-15 9:22:20 wishcraft $
+// ------------------------------------------------------------------------ //
+// CLORA - Chronolabs Australia //
+// Copyright (c) 2008 //
+// <http://www.chronolabs.org.au/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the SDPL Source Directive Public Licence //
+// as published by Chronolabs Australia; either version 2 of the License, //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Chronolab Australia //
+// Chronolabs International PO BOX 699, DULWICH HILL, NSW, 2203, Australia //
+// ------------------------------------------------------------------------ //
+
+if (!class_exists('qcp135_enumerator'))
+{
+ // error_reporting(0);
+
+ class qcp135_enumerator extends qcp135
+ {
+
+ var $elekey;
+ var $base;
+ var $len;
+
+ function __construct ($base, $len)
+ {
+ @$this->len = $len;
+ @$this->setElements($base);
+ }
+
+ private function setElements($base)
+ {
+ @$this->base = $base;
+ @$this->elekey = array();
+
+ foreach ($base->base as $key => $data)
+ {
+ if (strlen((string)$data)==1)
+ {
+ if (strlen(bindec(ord($data)))==5)
+ {
+ $offset = array("ice" => (int)substr(decbin(ord($data)),5,1),
+ "icd" => (int)substr(decbin(ord($data)),4,1),
+ "icc" => (int)substr(decbin(ord($data)),3,1),
+ "icb" => (int)substr(decbin(ord($data)),2,1),
+ "ica" => (int)substr(decbin(ord($data)),1,1));
+ if (substr(decbin(ord($data)),5,1)==1)
+ {
+ $offset['icf'] = 0;
+ } else {
+ $offset['icf'] = 1;
+ }
+ } elseif (strlen(decbin(ord($data)))==6)
+ {
+ $offset = array("icf" => (int)substr(decbin(ord($data)),6,1),
+ "ice" => (int)substr(decbin(ord($data)),5,1),
+ "icd" => (int)substr(decbin(ord($data)),4,1),
+ "icc" => (int)substr(decbin(ord($data)),3,1),
+ "icb" => (int)substr(decbin(ord($data)),2,1),
+ "ica" => (int)substr(decbin(ord($data)),1,1));
+ } elseif (strlen(decbin(ord($data)))==7)
+ {
+ $offset = array("ica" => (int)substr(decbin(ord($data)),6,1),
+ "icb" => (int)substr(decbin(ord($data)),5,1),
+ "icc" => (int)substr(decbin(ord($data)),4,1),
+ "icd" => (int)substr(decbin(ord($data)),3,1),
+ "ice" => (int)substr(decbin(ord($data)),2,1),
+ "icf" => (int)substr(decbin(ord($data)),1,1));
+ }
+ } else {
+ $offset = array("ica" => (int)substr(decbin(ord(substr($key,strlen($key)-1,1))),6,1),
+ "icb" => (int)substr(decbin(ord(substr($key,strlen($key)-1,1))),5,1),
+ "icc" => (int)substr(decbin(ord(substr($key,strlen($key)-1,1))),4,1),
+ "icd" => (int)substr(decbin(ord(substr($key,strlen($key)-1,1))),2,1),
+ "ice" => (int)substr(decbin(ord(substr($key,strlen($key)-1,1))),1,1),
+ "icf" => (int)substr(decbin(ord(substr($key,strlen($key)-1,1))),0,1));
+
+ }
+
+ if (strlen(decbin(ord($data)))==7)
+ {
+ if (strlen($data)==1)
+ {
+ $cycle = array("icf", "ice", "icd", "icc", "icb", "ica");
+ foreach ($cycle as $element)
+ {
+ if ($done==false)
+ {
+ if ($offset[$element]=='0')
+ {
+ if ($prev_ele!='')
+ {
+ if ($offset[$prev_ele] == '1')
+ {
+ $offset[$prev_ele] = '0';
+ } else {
+ $offset[$prev_ele] = '1';
+ }
+ }
+ $offset[$element]= '1';
+ $done=true;
+ }
+ }
+ }
+
+ } else {
+ $cycle = array("ica", "icb", "icc", "icd", "ice", "icf");
+ foreach ($cycle as $element)
+ {
+ if ($done==false)
+ {
+ if ($offset[$element]=='0')
+ {
+ if ($prev_ele!='')
+ {
+ if ($offset[$prev_ele] == '1')
+ {
+ $offset[$prev_ele] = '0';
+ } else {
+ $offset[$prev_ele] = '1';
+ }
+ }
+ $offset[$element]= '1';
+ $done=true;
+ }
+ }
+ }
+ }
+ }
+ $done=false;
+ if (strlen($data)==1)
+ {
+ @$this->elekey[$key] = array("key" => $data,
+ "bin" => decbin(ord($data)),
+ "offset" => $offset,
+ "flip" => 0);
+ } else {
+ @$this->elekey[$key] = array("key" => $data,
+ "bin" => decbin(ord($data)),
+ "offset" => $offset,
+ "flip" => 1);
+ }
+ }
+
+ }
+
+ private function getBytePos($char)
+ {
+ return floor((ord($char)+1)/4);
+ }
+
+ function enum_calc ($char, $enum_calc, $debug=false)
+ {
+ static $flip;
+
+ foreach ($enum_calc as $key => $value)
+ {
+ ${$key} = $value;
+ }
+
+ static $charnum;
+ $charnum++;
+ if ($charnum>3)
+ {
+ $charnum=1;
+ }
+
+ $nx_key.= $char;
+
+ if ($this->len>15)
+ {
+ if (strlen($nx_key)>$this->len)
+ {
+ $nx_key = substr($nx_key, strlen($nx_key)/($charnum+1), strlen($nx_key) - (strlen($nx_key)/($charnum+1))).substr($nx_key, 1, strlen($nx_key)-(strlen($nx_key) - (strlen($nx_key)/($charnum+1))));
+ }
+ } else {
+ if (strlen($nx_key)>32)
+ {
+ $nx_key = substr($nx_key, strlen($nx_key)/($charnum+1), strlen($nx_key) - (strlen($nx_key)/($charnum+1))).substr($nx_key, 1, strlen($nx_key)-(strlen($nx_key) - (strlen($nx_key)/($charnum+1))));
+ }
+ }
+
+ if ($this->elekey[$this->getBytePos($char)]['flip']==0)
+ {
+ $ica = $this->elekey[$this->getBytePos($char)]['offset']['ica'];
+ $icb = $this->elekey[$this->getBytePos($char)]['offset']['icb'];
+ $icc = $this->elekey[$this->getBytePos($char)]['offset']['icc'];
+ $icd = $this->elekey[$this->getBytePos($char)]['offset']['icd'];
+ $ice = $this->elekey[$this->getBytePos($char)]['offset']['ice'];
+ $icf = $this->elekey[$this->getBytePos($char)]['offset']['icf'];
+ } else {
+ if ($charnum==1)
+ {
+ $icf = $this->elekey[$this->getBytePos($char)]['offset']['ica'];
+ $ice = $this->elekey[$this->getBytePos($char)]['offset']['icb'];
+ $icd = $this->elekey[$this->getBytePos($char)]['offset']['icc'];
+ $icc = $this->elekey[$this->getBytePos($char)]['offset']['icd'];
+ $icb = $this->elekey[$this->getBytePos($char)]['offset']['ice'];
+ $ica = $this->elekey[$this->getBytePos($char)]['offset']['icf'];
+ } elseif ($charnum==2)
+ {
+ $icf = $this->elekey[$this->getBytePos($char)]['offset']['ica'];
+ $ice = $this->elekey[$this->getBytePos($char)]['offset']['icb'];
+ $icd = $this->elekey[$this->getBytePos($char)]['offset']['icc'];
+ $icc = $this->elekey[$this->getBytePos($char)]['offset']['icf'];
+ $icb = $this->elekey[$this->getBytePos($char)]['offset']['ice'];
+ $ica = $this->elekey[$this->getBytePos($char)]['offset']['icd'];
+ } else
+ {
+ $icf = $this->elekey[$this->getBytePos($char)]['offset']['icc'];
+ $ice = $this->elekey[$this->getBytePos($char)]['offset']['icb'];
+ $icd = $this->elekey[$this->getBytePos($char)]['offset']['ica'];
+ $icc = $this->elekey[$this->getBytePos($char)]['offset']['icd'];
+ $icb = $this->elekey[$this->getBytePos($char)]['offset']['ice'];
+ $ica = $this->elekey[$this->getBytePos($char)]['offset']['icf'];
+ }
+ }
+ for ($icount=1; $icount<65; $icount++)
+ {
+ if ($this->elekey[$icount]['offset']['ica'] == $icb && $this->elekey[$icount]['offset']['icb'] == $icc && $this->elekey[$icount]['offset']['icc'] == $icd) {
+ $nuclear .= '10';
+ if ($icb = $this->elekey[$icount]['flip']) {
+ $nuclear .= '0';
+ } else {
+ $nuclear .= '1';
+ }
+ if ($icc = $this->elekey[$icount]['flip']) {
+ $nuclear .= '0';
+ } else {
+ $nuclear .= '1';
+ }
+ if ($icd = $this->elekey[$icount]['flip']) {
+ $nuclear .= '0';
+ } else {
+ $nuclear .= '1';
+ }
+ }
+
+ if ($this->elekey[$icount]['offset']['ica'] == $icc && $this->elekey[$icount]['offset']['icb'] == $icd && $this->elekey[$icount]['offset']['icc'] == $ice) {
+ $nuclear .= '01';
+ if ($icb = $this->elekey[$icount]['flip']) {
+ $nuclear .= '0';
+ } else {
+ $nuclear .= '1';
+ }
+ if ($icc = $this->elekey[$icount]['flip']) {
+ $nuclear .= '0';
+ } else {
+ $nuclear .= '1';
+ }
+ if ($icd = $this->elekey[$icount]['flip']) {
+ $nuclear .= '0';
+ } else {
+ $nuclear .= '1';
+ }
+ }
+ }
+
+ // Change in version 1.6.4
+ if (strlen($nuclear)>32768)
+ $nuclear = substr($nuclear,strlen($nuclear)-32768,32768);
+
+ $result = $result + $ica;
+ $prince = $prince + $icb;
+ $karma = $karma + $icc;
+ $motivation = $motivation + $icd;
+ $official = $official + $ice;
+ $outs...
[truncated message content] |