Advertisement
ZeekoSec

Unown Hash Function 2

Apr 7th, 2015
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.48 KB | None | 0 0
  1. Private Shared Function Hash(text As String) As Tuple(Of Int32, Int32)
  2.     Dim charSet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`~!@#$%^&*()_+-=|[];',.{}:<>? "
  3.     Dim a As Int32 = 0
  4.     Dim b As Int32 = 0
  5.     For Each letter As var In text
  6.         Dim e = charSet.IndexOf(letter)
  7.         If e = -1 Then
  8.             e = charSet.Length + 1
  9.         End If
  10.         For i As var = 0 To 16
  11.             a = a * -6 + b + &H74fa - e
  12.             b = b / 3 + a + &H81be - e
  13.         Next
  14.     Next
  15.     Return Tuple.Create(a, b)
  16. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement