# Drop ext/mhash and add an emulation layer in ext/hash (5.3+), call for help

- Thread: https://externals.io/message/38065
- Original archive: https://news-web.php.net/php.internals/38065
- Started by Pierre Joye on 2008-06-01T23:02:52+00:00
- Messages: 11
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #38065 — Pierre Joye — 2008-06-01T23:02:52+00:00

URL: https://externals.io/message/38065#38065

Hi,

While working on the windows ports, I asked Sara about the mhash
status in regard of the new shiny ext/hash. The plan is to remove
ext/hash completely and emulate it in ext/hash to keep the BC. It
could even a configuration flag if one likes to be sure to clean his
code to use only the hash APIs.

As I would love to do it myself, I sadly don't have the time to do any
time soon. It would rock if someone could take the hand on it and send
a patch to us. I can help for any windows issue if any (that's what I
focus on these days).


Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

---

## #38066 — Lars Strojny — 2008-06-02T00:26:04+00:00

URL: https://externals.io/message/38065#38066 · In reply to: #38065

Hi Pierre,

Am Montag, den 02.06.2008, 01:02 +0200 schrieb Pierre Joye:
[...]
> While working on the windows ports, I asked Sara about the mhash
> status in regard of the new shiny ext/hash. The plan is to remove
> ext/hash completely and emulate it in ext/hash to keep the BC. It
 ^^^^^^^^
You mean ext/mhash, right?

cu, Lars

---

## #38067 — Pierre Joye — 2008-06-02T00:28:12+00:00

URL: https://externals.io/message/38065#38067 · In reply to: #38066

> Hi Pierre,
>
> Am Montag, den 02.06.2008, 01:02 +0200 schrieb Pierre Joye:
> [...]
> > […]
>  ^^^^^^^^
> You mean ext/mhash, right?

Yes, sorry for the confusion  :)


-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #38070 — Derick Rethans — 2008-06-02T08:21:43+00:00

URL: https://externals.io/message/38065#38070 · In reply to: #38065

> While working on the windows ports, I asked Sara about the mhash
> status in regard of the new shiny ext/hash. The plan is to remove
> ext/hash completely and emulate it in ext/hash to keep the BC. It
> could even a configuration flag if one likes to be sure to clean his
> code to use only the hash APIs.

The mhash extension features some more versions of some algorithms:
http://mhash.sourceforge.net/ But why bother changing it? I've not heard 
of any issues about ext/mhash.

regards,
Derick

---

## #38073 — Pierre Joye — 2008-06-02T08:30:13+00:00

URL: https://externals.io/message/38065#38073 · In reply to: #38070

> 
>
> > […]
>
> The mhash extension features some more versions of some algorithms:
> http://mhash.sourceforge.net/ But why bother changing it?

Which algo(s) (or algo version) is not supported by ext/hash? I did
not spot one after a quick read.

> I've not heard of any issues about ext/mhash.

My main reasons would be to do not have to maintain ext/mhash and  the
libmhash Windows port.

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #38079 — Scott MacVicar — 2008-06-02T10:34:28+00:00

URL: https://externals.io/message/38065#38079 · In reply to: #38073

Pierre Joye wrote:
> 
> > […]
> 
> Which algo(s) (or algo version) is not supported by ext/hash? I did
> not spot one after a quick read.
> 

sha192 and sha224
snefru128
md2

> > […]
> 
> My main reasons would be to do not have to maintain ext/mhash and  the
> libmhash Windows port.
> 
> Cheers,

I'm happy to see us removing a dependency, especially if it makes thigns 
easier to build on Windows.

Scott

---

## #38083 — Pierre Joye — 2008-06-02T17:06:38+00:00

URL: https://externals.io/message/38065#38083 · In reply to: #38079

> Pierre Joye wrote:
> > […]
>
> sha192 and sha224
> snefru128
> md2
>
> > […]
>
> I'm happy to see us removing a dependency, especially if it makes thigns
> easier to build on Windows.

In case someone likes to do it, Scott has volunteered and has already
added some of the missing algo in hash. He will also add the BC layer.

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

---

## #38089 — crrodriguez@suse.de — 2008-06-02T23:05:43+00:00

URL: https://externals.io/message/38065#38089 · In reply to: #38070

Derick Rethans escribió:

>I've not heard 
> of any issues about ext/mhash.

libmhash is no longer under development see
http://sourceforge.net/projects/mhash/

I guess that is enough reason to start thinking about a compatible 
replacement..





-- 
"Progress is possible only if we train ourselves to think about programs
  without thinking of them as pieces of executable code.” - Edsger W. 
Dijkstra

Cristian Rodríguez R.
Platform/OpenSUSE - Core Services
SUSE LINUX Products GmbH
Research & Development
http://www.opensuse.org/

---

## #38094 — Scott MacVicar — 2008-06-03T16:52:12+00:00

URL: https://externals.io/message/38065#38094 · In reply to: #38083

Pierre Joye wrote:
> 
> > […]
> 
> In case someone likes to do it, Scott has volunteered and has already
> added some of the missing algo in hash. He will also add the BC layer.

Appears that sha192 isn't supported by mhash and it looks like a typo in 
their documentation.

So the only one that needs added in snerfru 128 and perhaps changing the 
current hash algorith of snefru to snefru256 and adding an alias.

Scott

---

## #38651 — Scott MacVicar — 2008-06-26T23:19:16+00:00

URL: https://externals.io/message/38065#38651 · In reply to: #38083

Pierre Joye wrote:
> 
> > […]
> 
> In case someone likes to do it, Scott has volunteered and has already
> added some of the missing algo in hash. He will also add the BC layer.
> 
> Cheers,

ext/mhash now wraps around ext/hash in 5.3

I'd like to recommend we add a `E_DEPRECATED` to anything mhash_* related 
and drop the extension for 6?

I'll add the BC layer tomorrow to 6.0 regardless.

Scott

---

## #38654 — Derick Rethans — 2008-06-27T07:27:35+00:00

URL: https://externals.io/message/38065#38654 · In reply to: #38651

> Pierre Joye wrote:
> > […]
> 
> ext/mhash now wraps around ext/hash in 5.3
> 
> I'd like to recommend we add a `E_DEPRECATED` to anything mhash_* related and
> drop the extension for 6?

Why? The idea of this was not to get rid of mhash, it was to prevent the 
dependency on a library. I don't think we should just start getting rid 
of mhash.

regards,
Derick
