ograso
Journeyman
Posts: 135
Likes Given: 10
Likes Received: 2 in 2 posts
Joined: May 2014
Reputation: 0
|
Hashing
Hey UO Lovers,
I am trying to explain how can you create a simple hash algoritym and hash to player valuable information in your sphere server. everybody will apriciate If anyone can get more complex..
first thing first; Create hash algoritym..
Code:
[function hash]
if (STRMATCH("A", "<ARGS>"))
return fD
elif (STRMATCH("B", "<ARGS>"))
return ge
elif (STRMATCH("C", "<ARGS>"))
return hI
elif (STRMATCH("D", "<ARGS>"))
return ov
elif (STRMATCH("E", "<ARGS>"))
return Pl
elif (STRMATCH("F", "<ARGS>"))
return PR
elif (STRMATCH("G", "<ARGS>"))
return nN
elif (STRMATCH("H", "<ARGS>"))
return ux
elif (STRMATCH("I", "<ARGS>"))
return is
elif (STRMATCH("J", "<ARGS>"))
return qw
elif (STRMATCH("K", "<ARGS>"))
return kt
elif (STRMATCH("L", "<ARGS>"))
return Pq
elif (STRMATCH("M", "<ARGS>"))
return vv
elif (STRMATCH("N", "<ARGS>"))
return Iw
elif (STRMATCH("O", "<ARGS>"))
return qR
elif (STRMATCH("P", "<ARGS>"))
return mc
elif (STRMATCH("Q", "<ARGS>"))
return zp
elif (STRMATCH("R", "<ARGS>"))
return ad
elif (STRMATCH("S", "<ARGS>"))
return yu
elif (STRMATCH("T", "<ARGS>"))
return ls
elif (STRMATCH("U", "<ARGS>"))
return ej
elif (STRMATCH("V", "<ARGS>"))
return jk
elif (STRMATCH("W", "<ARGS>"))
return cv
elif (STRMATCH("X", "<ARGS>"))
return zy
elif (STRMATCH("Y", "<ARGS>"))
return hj
elif (STRMATCH("Z", "<ARGS>"))
return bn
elif (STRMATCH("0", "<ARGS>"))
return oy
elif (STRMATCH("1", "<ARGS>"))
return jj
elif (STRMATCH("2", "<ARGS>"))
return Ne
elif (STRMATCH("3", "<ARGS>"))
return Yt
elif (STRMATCH("4", "<ARGS>"))
return DW
elif (STRMATCH("5", "<ARGS>"))
return Lk
elif (STRMATCH("6", "<ARGS>"))
return Jg
elif (STRMATCH("7", "<ARGS>"))
return Jo
elif (STRMATCH("8", "<ARGS>"))
return N2
elif (STRMATCH("9", "<ARGS>"))
return b5
endif
second; You can encrypt anything like "gethash blabla"
Code:
[function gethash]
if !<isempty <ARGS>>
for 0 <eval strlen(<args>) - 1>
// sysmessage <dlocal._for> - <strsub <dlocal._for> 1 <args>> -- H: <hash <strsub <dlocal._for> 1 <args>>>
LOCAL.HASH .= "<hash <strsub <dlocal._for> 1 <args>>>"
endfor
return <STRSUB 1 0 <LOCAL.HASH>>
endif
third; entered pin will get hash with this function
Code:
[function pinrecord]
account.tag.pin <gethash <args>>
fourth;
Code:
[function pincheck]
if (!<isempty <args>> && !<isempty <account.tag.pin>>)
if (STRMATCH("<account.tag.pin>", "<gethash <args>>")
return 1
endif
endif
Thanks to xwerswoodx
Another solution with MD5
Code:
[function guv]
tag0.pin <md5hash <args>>
[function pingir]
if <f_strm <md5hash <args>>,<tag0.pin>>
src.say @,,1 succeed
else
src.say @,,1 Failed
endif
Code:
[function f_strm]
if (STRMATCH(*<argv[0]>*,'<argv[1]>'))
return 1
else
return 0
endif
Thanks to Adrien
(This post was last modified: 02-20-2015 04:25 AM by ograso.)
|
|