PHPackages                             securehash/securehash - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. securehash/securehash

ActiveLibrary

securehash/securehash
=====================

Class to encrypt data easily with hash algorithms

017PHP

Since Oct 9Pushed 11y ago1 watchersCompare

[ Source](https://github.com/SiroDiaz/SecureHash)[ Packagist](https://packagist.org/packages/securehash/securehash)[ RSS](/packages/securehash-securehash/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

SecureHash
==========

[](#securehash)

PHP Class to encrypt data easily with hash algorithms

requires PHP 5 &gt;= 5.3.0

Composer
--------

[](#composer)

```
$ composer require securehash/securehash:dev-master

```

Quick Start and Examples
------------------------

[](#quick-start-and-examples)

### Supported algorithms

[](#supported-algorithms)

md2, md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd128, ripemd160, ripemd256, ripemd320, whirlpool, tiger128,3, tiger160,3, tiger192,3, tiger128,4, tiger160,4, tiger192,4, snefru, snefru256, gost, adler32, crc32, crc32b, salsa10(non supported in PHP 5.4.0 and later), salsa20(non supported in PHP 5.4.0 and later), 'haval128,3', 'haval160,3', 'haval192,3', 'haval224,3', 'haval256,3', 'haval128,4', 'haval160,4', 'haval192,4', 'haval224,4', 'haval256,4', 'haval128,5', 'haval160,5', 'haval192,5', 'haval224,5' and 'haval256,5'.

### SecureHash class

[](#securehash-class)

#### Methods

[](#methods)

getValue, getAlgo, getAlgorithms, setValue, setAlgo, cifrate, cifrateFile, cifrateUrl, cifrateMultiple, cifrateMultipleFiles, cifrateMultipleUrls, compare, compareFiles, compareUrls

#### Examples

[](#examples)

Simple string hashing.

```
require 'Secure.php';
// 'as SH' is to set an alias of SecureHash class name
// and it is optional
use Secure\SecureHash as SH;

$a = new SH('sha512', 'Hello World!');
echo $a->cifrate();
```

Hashing a file.

```
require 'Secure.php';
use Secure\SecureHash as SH;

$a = new SH();	// defaults algorithm md5 and default value ''
$a->setAlgo('crc32');
$a->setValue('css/normalize.css');	// change the value to be encrypted
echo $a->cifrateFile();
```

Print all algorithms implemented by PHP in your current version

```
require 'Secure.php';
use Secure\SecureHash as SH;

$a = new SH();
var_dump($a->getAlgorithms());
```

Check if two urls contains the same data

```
require 'Secure.php';
use Secure\SecureHash as SH;

$jqueryGoogle = 'http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js';
$jqueryjQuery = 'http://code.jquery.com/jquery-2.1.1.min.js';

$a = new SH('ripped160');
var_dump($a->compareUrls($jqueryGoogle, $jqueryjQuery));	// true if are equals, false if not
```

Encrypt the content of multiple urls

```
require 'Secure.php';
use Secure\SecureHash as SH;

$urls = array(
	'http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js',
	'http://code.jquery.com/jquery-2.1.1.min.js'
);

$a = new SH('sha512')
$cifratedUrls = $a->cifrateMultipleUrls($urls);	// returns an array with the data encripted
var_dump($cifratedUrls);
```

### Static class version: methods and examples

[](#static-class-version-methods-and-examples)

#### Methods

[](#methods-1)

getAlgorithms, cifrate, cifrateFile, cifrateUrl, cifrateMultiple, cifrateMultipleFiles, cifrateMultipleUrls, compare, compareFiles, compareUrls

#### Examples

[](#examples-1)

Simple string hashing.

```
require 'SecureStatic.php';
// 'as SH' is to set an alias of SecureHash class name
// and it is optional
use Secure\SecureStatic\SecureHash as SH;

echo SH::cifrate('sha512', 'Hello World!');
```

Hashing a file.

```
require 'SecureStatic.php';
use Secure\SecureStatic\SecureHash as SH;

echo SH::cifrateFile('md4', 'route/to/file.extension');
```

Print all algorithms implemented by PHP in your current version

```
require 'SecureStatic.php';
use Secure\SecureStatic\SecureHash as SH;

var_dump(SH::getAlgorithms());
```

Check if two urls contains the same data

```
require 'SecureStatic.php';
use Secure\SecureStatic\SecureHash as SH;

$jqueryGoogle = 'http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js';
$jqueryjQuery = 'http://code.jquery.com/jquery-2.1.1.min.js';

// true if are equals, false if not
var_dump(SH::compareUrls('ripped160', $jqueryGoogle, $jqueryjQuery));
```

Encrypt the content of multiple urls

```
require 'SecureStatic.php';
use Secure\SecureStatic\SecureHash as SH;

$urls = array('http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js', 'http://code.jquery.com/jquery-2.1.1.min.js');

$cifratedUrls = SH::cifrateMultipleUrls('sha512', $urls);	// returns an array with the data encripted
var_dump($cifratedUrls);
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7469286?v=4)[Siro Díaz Palazón](/maintainers/SiroDiaz)[@SiroDiaz](https://github.com/SiroDiaz)

---

Top Contributors

[![SiroDiaz](https://avatars.githubusercontent.com/u/7469286?v=4)](https://github.com/SiroDiaz "SiroDiaz (17 commits)")

### Embed Badge

![Health badge](/badges/securehash-securehash/health.svg)

```
[![Health](https://phpackages.com/badges/securehash-securehash/health.svg)](https://phpackages.com/packages/securehash-securehash)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
