paint-brush
Fun with Flags: How to Make Flags in C# with Enums and Bit Shiftingby@turnerj
168 reads

Fun with Flags: How to Make Flags in C# with Enums and Bit Shifting

by Turnerj10mDecember 17th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Using enums and bit shifting, you can encode complex values into a single number. This article walks through an example of how I encoded and decoded a number can be used to render different country flags.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Fun with Flags: How to Make Flags in C# with Enums and Bit Shifting
Turnerj HackerNoon profile picture
Turnerj

Turnerj

@turnerj

aka. James Turner — a programmer and entrepreneur with a love of cars, music and technology

About @turnerj
LEARN MORE ABOUT @TURNERJ'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Turnerj HackerNoon profile picture
Turnerj@turnerj
aka. James Turner — a programmer and entrepreneur with a love of cars, music and technology

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here