Eindwerk hbo5 programmeren :: Bitwise operator

in #programmeren5 years ago

Logo
In vervolg op mijn vorige post.

Tijdens het maken van het login systeem heb ik hard nagedacht over het gebruik van een matrix voor het authenticatie systeem. Maar dit werd al snel complex en groot. Voor een eindwerk had ik dus iets nodig dat.

  1. Simple was in gebriuk
  2. Recht toe recht aan

Dus kwam ik uit bij een bitwise authenticatie.

Een bitwise operator gaat twee of meerdere getallen controleren op een binair niveau. Maar je kan de getallen doorgeven als een decimaal. Dit houd dus in dat je bijvoorbeeld kan zeggen dat bit 1 moet aanstaan alvorens iemand kan inloggen. Dus iemand met een authenticatie level van 4 zal dus niet kunnen inloggen maar iemand met 5 wel.

4 = 0100 en 5 = 0101. Als we dus de eerste bit gaan controleren op inloggen zien we in dit voorbeeld perfect dat 4 = false en 5 = true.

Ik hoop dat ik bij deze iemand heb kunnen inspireren op het gebruik van de bitwise operator.

Sort:  

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by ZoeF from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Hi @zoef!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 3.822 which ranks you at #4668 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 225 contributions, your post is ranked at #208.

Evaluation of your UA score:
  • You're on the right track, try to gather more followers.
  • The readers like your work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server