D devmobile Active Member Licensed User Nov 7, 2017 #1 Hello In my project,i need generate random string code about 1 million records I can generate random code with RandomLibrary in php and it is very powerful library But do we have library looklike php library in b4j?
Hello In my project,i need generate random string code about 1 million records I can generate random code with RandomLibrary in php and it is very powerful library But do we have library looklike php library in b4j?
Erel B4X founder Staff member Licensed User Longtime User Nov 7, 2017 #2 Code: Copy Sub GenerateRandomString (Length As Int) As String Dim su As StringUtils Dim bytes(Length) As Byte SecureRandom1.GetRandomBytes(bytes) Return su.EncodeBase64(bytes).SubString2(0, Length) End Sub SecureRandom1 is a SecureRandom global variable (jEncryption or Encryption libraries). Upvote 0
Code: Copy Sub GenerateRandomString (Length As Int) As String Dim su As StringUtils Dim bytes(Length) As Byte SecureRandom1.GetRandomBytes(bytes) Return su.EncodeBase64(bytes).SubString2(0, Length) End Sub SecureRandom1 is a SecureRandom global variable (jEncryption or Encryption libraries).
D devmobile Active Member Licensed User Nov 7, 2017 #3 Erel said: Code: Copy Sub GenerateRandomString (Length As Int) As String Dim su As StringUtils Dim bytes(Length) As Byte SecureRandom1.GetRandomBytes(bytes) Return su.EncodeBase64(bytes).SubString2(0, Length) End Sub SecureRandom1 is a SecureRandom global variable (jEncryption or Encryption libraries). Click to expand... I need make 1 million code with this function Maybe generate same random string with this function? Upvote 0
Erel said: Code: Copy Sub GenerateRandomString (Length As Int) As String Dim su As StringUtils Dim bytes(Length) As Byte SecureRandom1.GetRandomBytes(bytes) Return su.EncodeBase64(bytes).SubString2(0, Length) End Sub SecureRandom1 is a SecureRandom global variable (jEncryption or Encryption libraries). Click to expand... I need make 1 million code with this function Maybe generate same random string with this function?
Cableguy Expert Licensed User Longtime User Nov 7, 2017 #4 devmobile said: I need make 1 million code with this function Maybe generate same random string with this function? Click to expand... Being it RANDOM it will be very difficult to create the SAME string more than ONCE! Upvote 0
devmobile said: I need make 1 million code with this function Maybe generate same random string with this function? Click to expand... Being it RANDOM it will be very difficult to create the SAME string more than ONCE!
D devmobile Active Member Licensed User Nov 7, 2017 #5 Cableguy said: Being it RANDOM it will be very difficult to create the SAME string more than ONCE! Click to expand... Thank you I decide to use php random library finally Upvote 0
Cableguy said: Being it RANDOM it will be very difficult to create the SAME string more than ONCE! Click to expand... Thank you I decide to use php random library finally
Cableguy Expert Licensed User Longtime User Nov 7, 2017 #6 I don't get it, what exactly do you want to do? 1- create 1Million different and Randing Strings or 2- create 1random string a populate 1Million records with it? Upvote 0
I don't get it, what exactly do you want to do? 1- create 1Million different and Randing Strings or 2- create 1random string a populate 1Million records with it?