Bitpay\Util\Util::twoSha256 PHP Метод

twoSha256() публичный статический Метод

Returns a double SHA256 hash of a value.
public static twoSha256 ( string $data, $binary = false ) : string
$data string
Результат string
    public static function twoSha256($data, $binary = false)
    {
        return self::sha256(self::sha256($data, $binary), $binary);
    }

Usage Example

Пример #1
0
 /**
  * @see https://github.com/bitpay/bitcore/blob/master/test/test.util.js
  */
 public function testTwoSha256()
 {
     $data = array(array('907c2bc503ade11cc3b04eb2918b6f547b0630ab569273824748c87ea14b0696526c66ba740200000000fd1f9bdd4ef073c7afc4ae00da8a66f429c917a0081ad1e1dabce28d373eab81d8628de80200000000ad042b5f25efb33beec9f3364e8a9139e8439d9d7e26529c3c30b6c3fd89f8684cfd68ea0200000000599ac2fe02a526ed040000000008535300516352515164370e010000000003006300ab2ec2291fe51c6f', '60d8ec2b9241235914528efcc7b32315062d78c8dc12e09bbfdd4cb00563be5b'));
     foreach ($data as $datum) {
         $this->assertSame($datum[1], Util::twoSha256($datum[0]));
     }
 }
All Usage Examples Of Bitpay\Util\Util::twoSha256