Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ examples/.DS_Store
# PHPUnit
.phpunit.cache/
.phpunit.result.cache
test/unit/_html
test/unit/_html
test/unit/BitPayKeyUtils/Storage/test1.txt
test/unit/BitPayKeyUtils/Storage/test11.txt
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"ext-iconv": "*"
},
"require-dev": {
"phpunit/phpunit": "10.5.45"
"phpunit/phpunit": "^10.5.48"
},
"suggest": {
"ext-gmp": "Required to use this package with GMP instead of BCMath"
"ext-gmp": "GMP provides better performance than BCMath"
}
}
}
54 changes: 31 additions & 23 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions src/BitPayKeyUtils/Util/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ class Util

/**
* Computes a digest hash value for the given data using
* the given method, and returns a raw or binhex encoded
* string, see:
* http://us1.php.net/manual/en/function.openssl-digest.php
* the hash function.
*
* @param string $data
*
* @return string
*/
public static function sha512($data)
{
return openssl_digest($data, 'sha512');
return hash('sha512', $data);
}

/**
Expand Down Expand Up @@ -68,7 +66,7 @@ public static function sha256ripe160($data)
*/
public static function ripe160($data, $binary = false)
{
return openssl_digest($data, 'ripemd160', $binary);
return hash('ripemd160', $data, $binary);
}

/**
Expand All @@ -84,7 +82,7 @@ public static function ripe160($data, $binary = false)
*/
public static function sha256($data, $binary = false)
{
return openssl_digest($data, 'SHA256', $binary);
return hash('sha256', $data, $binary);
}

/**
Expand Down