LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search if a username already exists

Hello,

I am trying to develop a User interface login and signup. And I am trying to check if a username already exists. So far this is what I have done.

Thank you

enekomujika_1-1703161548834.png

 

Download All
0 Kudos
Message 1 of 6
(763 Views)

@eneko.mujika wrote:

I am trying to develop a User interface login and signup.

And I am trying to check if a username already exists.

So far this is what I have done.


And what's the question?

 

  • On your image: you also need to wire the "user column" array to the SearchArray function to be able to search for usernames…
  • Use IndexArray to index the first column from your CSV data (resulting in an 1D array), then use ArraySubset to only use a subset starting with the 2nd element…
  • Using AutoCleanup would improve the block diagram!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(751 Views)

Cleaned it up a bit:

 

Tests(1).png

0 Kudos
Message 3 of 6
(706 Views)

If you just want to see if a user exists, build a set.

If you want to see if a user exists and if yes, also lookup the password, build a map.

 

(Compared to array operations, it makes little difference for small datasets, but would be significantly more efficient once you have thousands of users. sets and maps also have better error checking, because duplicate users cannot exist.)

0 Kudos
Message 4 of 6
(692 Views)

I'd say if I were really doing it, I'd want to either use a database or an actually secure toolkit for things.

0 Kudos
Message 5 of 6
(689 Views)

Yes, of course. The password in the file could be stored as encrypted string (e.g. MD5) to be compared with the encrypted password entered. A very mild layer of security. Yes, there are better ways!

 

Here's a quick demo how you would use a map. As I said, the password should never exist in clear text on the diagram or in the file.

 

altenbach_0-1703190867099.png

 

Message 6 of 6
(684 Views)