-
May 24th, 2024, 09:46 PM
#1
Thread Starter
New Member
How to reserved this code ? Pls
I have code like this :
HTML Code:
Public Function Hash(ByVal fileName As String) As UInt64
Dim id As UInt64 = 0
Dim index As Integer = 0
For Each c As Char In fileName
If (AscW(c) >= AscW("A")) AndAlso (AscW(c) <= AscW("Z")) Then
id = (id + (++index) * (AscW(c) + AscW("a") - AscW("A"))) Mod &H8000000BUI * &HFFFFFFEF
Else
id = (id + (++index) * AscW(c)) Mod &H8000000BUI * &HFFFFFFEF
End If
Next
Return (id Xor &H12345678)
End Function
-
May 24th, 2024, 09:49 PM
#2
Re: How to reserved this code ? Pls
Are you asking how to reverse this Hash process? Like an "UnHash" that will return the original String? If not then you need to be much clearer on what specifically you are looking for help with.
-
May 24th, 2024, 10:29 PM
#3
Thread Starter
New Member
Re: How to reserved this code ? Pls
 Originally Posted by OptionBase1
Are you asking how to reverse this Hash process? Like an "UnHash" that will return the original String? If not then you need to be much clearer on what specifically you are looking for help with.
Yes, i need unhash return the original string
-
May 25th, 2024, 01:38 AM
#4
Re: How to reserved this code ? Pls
-
May 25th, 2024, 04:01 AM
#5
Re: How to reserved this code ? Pls
Hashing is specifically a one-way process. That's one of the main points of hashing, e.g. it allows you to compare a password at login to a password at registration based on their hashes but never let's you get the registration password back from the stored hash. If you want a two-way process then you want encryption rather than hashing. Note that hashes are also usually fairly short, so they allow you to do things like confirm that a large file download with error by hashing what you got and comparing it with the hash of the original. Encrypted data may be much longer because it needs to store a representation of all the original data. Hashes are such that multiple original values can produce the same hash, whereas that should never be the case for encrypted data.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|