|
@@ -254,7 +254,7 @@ class Utils
|
|
|
}
|
|
|
$buffer = unpack('C*', hex2bin($message));
|
|
|
$prefix = bin2hex("\u{0019}Ethereum Signed Message:\n" . sizeof($buffer));
|
|
|
- return Keccak::hash(hex2bin($prefix . $message), self::HASH_SIZE);
|
|
|
+ return Keccak::hash(hex2bin($prefix . $message), 256);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -381,6 +381,11 @@ class Utils
|
|
|
return $bn->divide($bnt);
|
|
|
}
|
|
|
|
|
|
+ public static function strToHex($str) {
|
|
|
+ $hex = unpack('H*', $str);
|
|
|
+ return '0x' . array_shift($hex);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* jsonMethodToString
|
|
|
*
|