'this was written by Erel in a different context
Sub GenerateRandomString (Length As Int) As String
Dim su As StringUtils
Dim bytes(Length) As Byte
Private secureRandom1 As SecureRandom
secureRandom1.GetRandomBytes(bytes)
Return su.EncodeBase64(bytes).SubString2(0, Length)
End Sub
Sub CheckLicense
Dim bc As BCrypt
Dim hash As String = bc.hashpw(GenerateRandomString(10),bc.gensalt)
lc.Initialize("lc", GetDeviceId, publicKey, hash.GetBytes("UTF8"))
' lc.SetVariableAndValue("test2", "abd")
lc.CheckAccess
End Sub