mirror of
https://github.com/kvazar-network/crawler-api-node.git
synced 2025-01-08 22:27:55 +00:00
20 lines
383 B
PHP
20 lines
383 B
PHP
|
<?php
|
||
|
|
||
|
class Hash {
|
||
|
|
||
|
public static function SHA256(string $data, $raw = true): string {
|
||
|
|
||
|
return hash('sha256', $data, $raw);
|
||
|
}
|
||
|
|
||
|
public static function sha256d(string $data): string {
|
||
|
|
||
|
return hash('sha256', hash('sha256', $data, true), true);
|
||
|
}
|
||
|
|
||
|
public static function RIPEMD160(string $data, $raw = true): string {
|
||
|
|
||
|
return hash('ripemd160', $data, $raw);
|
||
|
}
|
||
|
}
|