<?php
$_shortHashCode = new Func("_shortHashCode", function($str = null) use (&$undefined, &$Date) {
$o = new Object();
set($o, "lz", new Func(function($i = null, $c = null) {
if (!eq(_typeof($c), "number") || $c <= 0.0 || !eq(_typeof($i), "number") && !eq(_typeof($i), "string")) {
return $i;
}
$i += "";
while (get($i, "length") < $c) {
$i = _concat("0", $i);
}
return $i;
}));
set($o, "getHashCode", new Func(function($s = null) {
$hash = 0.0; $c = eq(_typeof($s), "string") ? get($s, "length") : 0.0; $i = 0.0;
while ($i < $c) {
$hash = _plus(((to_number($hash) << 5.0) - to_number($hash)), call_method($s, "charCodeAt", $i++));
}
return $hash < 0.0 ? _plus((to_number($hash) * -1.0), 4294967295.0) : $hash;
}));
set($o, "uniqueId", new Func(function($s = null) use (&$undefined, &$o, &$Date) {
if (eq($s, $undefined) || !eq(_typeof($s), "string")) {
if (not(get($o, "___uqidc"))) {
set($o, "___uqidc", 0.0);
} else {
set($o, "___uqidc", 1, "+=", false);
}
$od = _new($Date); $i = $s = _concat(call_method($od, "getTime"), "", get($o, "___uqidc"));
} else {
$i = call_method($o, "getHashCode", $s);
}
$s = _plus(call_method($i, "toString", 32.0), call_method($o, "lz", call_method(to_number(get($s, "length")) * 4.0, "toString", 16.0), 3.0));
return call_method($s, "toUpperCase");
}));
return call_method($o, "uniqueId", $str);
});
$arr_guids = new Arr(