PHPackages                             trihydera/hashutils - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. trihydera/hashutils

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

trihydera/hashutils
===================

v1.0.1(1y ago)014GPL-2.0-onlyPHP

Since Jun 16Pushed 1y agoCompare

[ Source](https://github.com/TriHyderaPHP/hashutils)[ Packagist](https://packagist.org/packages/trihydera/hashutils)[ RSS](/packages/trihydera-hashutils/feed)WikiDiscussions master Synced today

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Intro
=====

[](#intro)

A simple PHP library for hashing text, getting and verifying an user hash

Getting started
===============

[](#getting-started)

Require this package, with [Composer](https://getcomposer.org), in the root directory of your project.

```
composer require trihydera/hashutils
```

HashID Class
============

[](#hashid-class)

Overview
--------

[](#overview)

The `HashID` class is designed to handle generating and verifying hashed user IDs based on the user's IP address.

Usage
-----

[](#usage)

1. Instantiate the `HashID` class by providing an optional salt value.
2. Use the `gen()` method to generate a hashed ID based on the user's IP address.
3. Use the `verify($hash)` method to verify if a given hash matches the generated hash.

Example
-------

[](#example)

```
