SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 22/11/2017, 10:43 PM   #21
adri1
High-roller
 
adri1's Avatar
 
Join Date: Oct 2010
Posts: 1,944
Reputation: 931
Default Re: MurmurHash3

Why don't you use SHA256_PassHash function?
adri1 is offline   Reply With Quote
Old 22/11/2017, 11:03 PM   #22
ThePhenix
Gangsta
 
ThePhenix's Avatar
 
Join Date: May 2012
Posts: 795
Reputation: 121
Default Re: MurmurHash3

Quote:
Originally Posted by adri1 View Post
Why don't you use SHA256_PassHash function?
Because Murmurhash is not meant to be used for passwords. It could be used for the same purposes as Bernstein.
I would like to see some speed comparisons versus Bernstein as I think Bernstein is definitely faster. I'm not sure.
ThePhenix is offline   Reply With Quote
Old 23/11/2017, 01:19 AM   #23
Chaprnks
Gangsta
 
Chaprnks's Avatar
 
Join Date: Sep 2007
Location: Soviet America
Posts: 676
Reputation: 41
Default Re: MurmurHash3

Quote:
Originally Posted by Y_Less View Post
I do. And I'm impressed with both the way they took on the advice from their last topic, AND the code they used for benchmarking. What I would like to see is a comparison against just the "bernstein()" function from YSI - that's the one used the most throughout my code at least, since it is tuned in assembly.

I would point out that the one advantage of the other hashes over this one is that they can be implemented at compile time (see y_stringhash), and thus for constant strings there is no run-time overhead. But if you aren't doing that, this is good.
I'm curious, would this be possible to implement Mumurhash into y_stringhash?
__________________
Chaprnks is offline   Reply With Quote
Old 23/11/2017, 05:16 AM   #24
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Home
Posts: 3,185
Reputation: 676
Default Re: MurmurHash3

Quote:
Originally Posted by adri1 View Post
Why don't you use SHA256_PassHash function?
slower, lengthy.
Quote:
Originally Posted by Chaprnks View Post
I'm curious, would this be possible to implement Mumurhash into y_stringhash?
no and why would you.

It will give zero advantage, if you mean "run it at the compiling runtime" then no, it won't be possible, plugin doesn't work until you start the server.
__________________
Find me on GitHub SEF Community (Official NEF Successor) SALobby Community SA:MP Reviews
Kaperstone is offline   Reply With Quote
Old 23/11/2017, 09:53 AM   #25
ShapeGaz
Little Clucker
 
Join Date: Sep 2017
Posts: 8
Reputation: 4
Default Re: MurmurHash3

Quote:
Originally Posted by ThePhenix View Post
Because Murmurhash is not meant to be used for passwords. It could be used for the same purposes as Bernstein.
I would like to see some speed comparisons versus Bernstein as I think Bernstein is definitely faster. I'm not sure.
You want compare hash functions in pawn or what?

Quote:
Originally Posted by adri1 View Post
Why don't you use SHA256_PassHash function?
Because MumurHash isn't for security and why I need use SHA256, if exist SHA256?...
ShapeGaz is offline   Reply With Quote
Old 23/11/2017, 11:39 AM   #26
Calgon
Godfather
 
Calgon's Avatar
 
Join Date: Jan 2009
Posts: 6,434
Reputation: 1060
Default Re: MurmurHash3

Quote:
Originally Posted by Kaperstone View Post
slower, lengthy.

no and why would you.
What do you mean no? Why isn't it possible?
__________________
Calgon is offline   Reply With Quote
Old 23/11/2017, 07:09 PM   #27
Y_Less
Spam Machine
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 14,538
Reputation: 2938
Default Re: MurmurHash3

It isn't possible because it can't be done at compile time. y_stringhash has three algorithms - bernstein, FNV1, and FNV1a. All three of those are very simple, and can be implemented in a single line of code. Thus, I can write a macro to generate the hash when you compile, so you can use it in "switch" and similar. They go for a balance of speed, distribution, and simplicity. Murmur3 throws simplicity out the window to improve the other two slightly. It you look at the code, you see there's no way to do that in a simple single line of code (it also doesn't help that this operates on 4 bytes at once, not a single char - maybe there is a simpler implementation that does it the single-step way).
Y_Less is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MurmurHash3 for PWN. CaHbKo Scripting Help 7 16/07/2012 11:31 AM


All times are GMT. The time now is 05:35 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.