Replace Utils::toHex() with direct conversion.

This commit is contained in:
Pavel Rubin 2018-04-04 05:10:39 +03:00
parent 4df0835f2b
commit c2fc8cb7c1

View File

@ -59,7 +59,7 @@ class Str extends SolidityType implements IType
*/
public function inputFormat($value, $name)
{
$value = Utils::toHex($value);
$value = implode('', unpack('H*', $value));
$prefix = IntegerFormatter::format(mb_strlen($value) / 2);
$l = floor((mb_strlen($value) + 63) / 64);
$padding = (($l * 64 - mb_strlen($value) + 1) >= 0) ? $l * 64 - mb_strlen($value) : 0;