Skip to content

Commit

Permalink
readme for php8
Browse files Browse the repository at this point in the history
  • Loading branch information
arkhamvm committed Feb 3, 2022
1 parent 99928db commit 23da77c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*MurmurHash* is an algorithm desiged by Austin Appleby.

## Changes
1. Add PHP 7 support.
1. Add PHP 7.x/8.0 support.
2. Seed parameter can be omitted.

## Install
Expand All @@ -15,8 +15,7 @@ make
sudo make install
```


Create `murmurhash3.ini` in lib dir (for example php 7.1: `/etc/php/7.1/mods-available/`):
Create `murmurhash3.ini` in lib dir (for example php 8.0: `/etc/php/8.0/mods-available/`):
```
extension=murmurhash3.so
```
Expand All @@ -29,14 +28,17 @@ sudo phpenmod murmurhash3
## Usage

```php
<?php
// Example
echo murmurhash3('anystring'); // default seed usage
echo murmurhash3('anystring', 123); // specific seed usage
echo murmurhash3('anystring') . PHP_EOL; // default seed usage
echo murmurhash3('anystring', 123) . PHP_EOL; // specific seed usage

// Some locale strings
echo murmurhash3('№АаЯя');
echo murmurhash3('№АаЯя') . PHP_EOL;

// Example from @maksimf
echo murmurhash3('豥붢㦖徱阵儹㜀耄巅簏罚撦');
echo murmurhash3('豥붢㦖徱阵儹㜀耄巅簏罚撦', 1096928849);
echo murmurhash3('豥붢㦖徱阵儹㜀耄巅簏罚撦') . PHP_EOL;
echo murmurhash3('豥붢㦖徱阵儹㜀耄巅簏罚撦', 1096928849) . PHP_EOL;

echo 'all ok' . PHP_EOL;
```

0 comments on commit 23da77c

Please sign in to comment.