Hi this is my basic registration scheme that makes a Hex code from a username it only basic cos it my first try, Just thought it maybe handy to someone comments and suggestions welcome.

vbnet Code:
  1. Public Class Form1
  2.  
  3.     Private Function CheckCode(ByVal Username As String, ByVal Code As String) As Boolean
  4.         Dim sn As String = MakeCode(Username)
  5.         Return sn.Equals(Code)
  6.     End Function
  7.  
  8.     Private Function MakeCode(ByVal Username As String) As String
  9.         Dim MagicSeed As Integer = &H1B1F
  10.         Dim sn As Integer = 0
  11.  
  12.         For Each c As Char In Username
  13.             'Plus sn and MagicSeed times username char value.
  14.             sn += MagicSeed * Asc(c)
  15.         Next
  16.  
  17.         'Return hex or you may want to just return a number.
  18.         Return Hex(sn)
  19.     End Function
  20.  
  21.     Private Sub cmdDemo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDemo.Click
  22.         Dim code As String = MakeCode("John")
  23.         'Show generated code.
  24.  
  25.         MessageBox.Show("Serial =" & code, "Demo", MessageBoxButtons.OK, MessageBoxIcon.Information)
  26.  
  27.         'Test 1
  28.         MessageBox.Show("Serial Match = " & CheckCode("John", "2A4551"), "Demo",
  29.                         MessageBoxButtons.OK, MessageBoxIcon.Information)
  30.     End Sub
  31. End Class