< Public Function MessageDigest (Text As String, Code As String) As String (?)
Comments' ' Returns a 4-letter code calculated from the message 'This is generally used to "digitally sign" a message, i.e. it's easier 'to produce a digest from the message than it is to producea message with 'a given digest. ' 'This is a relatively insecure implementation, designed for low-risk 'usage. For more security, use the MD5 hash calculation (see link from 'the PHP home page for more details)
Public Function MessageDigest (Text As String, Code As String) As String
Dim i As Integer
Dim Modulo As Long
Dim MaxNum As Long
Dim Multiplier As Integer
Dim Count As Long
Dim Adder As Integer
Modulo = 36 ^ 4 + Asc(Left(Code, 1))
MaxNum = 36 ^ 4
Adder = Asc(Right(Code, 1))
Const Alphabet As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
For i = 1 To Len(Text)
Count = Count + (Asc(Mid(Text, i, 1)) ^ 3) + Adder
Count = Count - Int(Count / Modulo) * Modulo
Next i
Count = Count - Int(Count / MaxNum) * MaxNum
Dim CharNum As Integer
Dim Char As String
For i = 3 To 0 Step -1
CharNum = Int(Count / (36 ^ i))
Char = Mid(Alphabet, CharNum + 1, 1)
Count = Count - (CharNum * (36 ^ i))
MessageDigest = MessageDigest & Char
Next i
End Function