Why Hex() returns upper case letters?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

Why Hex() returns upper case letters?

Post by Lebostein »

....but other hex functions returns lower cased letters, for example MD5Fingerprint() or SHA1Fingerprint().
This is not consistent. Or what is the reason for that?
PB Fanatic
User
User
Posts: 49
Joined: Wed Dec 17, 2014 11:54 am

Re: Why Hex() returns upper case letters?

Post by PB Fanatic »

I read it's because of using the "0x" prefix in some languages, so that "0xBEEF" doesn't look like "0xbeef". MD5 and SHA1 don't get prefixed with "0x", so their case doesn't matter. Perhaps they should go in upper case to match hex, but common use always has them in lower case (see MD5 and SHA1 in Wikipedia).
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Why Hex() returns upper case letters?

Post by luis »

Uppercase is better for energy consumption.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: Why Hex() returns upper case letters?

Post by heartbone »

Lebostein wrote:....but other hex functions returns lower cased letters, for example MD5Fingerprint() or SHA1Fingerprint().
This is not consistent. Or what is the reason for that?
Are you suggesting DISCRIMINATION??? :?: :|
Keep it BASIC.
Post Reply