KeePassXC to generate and store passwords. For example, generating a password with a length of 128 characters without using the extended ASCII character table, the entropy is about 770 - 800 bits. I have read that entropy in cryptography is a measure of the randomness or diversity of a data-generating function. But why in bits and how is this number calculated?
The reason we measure entropy in bits is because it's a convenient measure when working with computers. Each additional bit of entropy adds twice as many possibilities. So if, for example, a secret has 8 bits of entropy, then there are 256 (2^8) possibilities it could be.
Now, those 256 possibilities don't have to be exactly 8 bits (a byte long). Picking uniformly from the set of strings from "1" to "256" would also provide a string with this much entropy. What essentially matters is that the set of input strings, however we define or encode them, comes from a set of the appropriate size.