Skip to content

chloelaisne/BaseConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BaseConverter is a numeric base converter class.

The converter implements:
- Binary to decimal conversion.
- Decimal to binary conversion.
- Decimal to hexadecimal conversion.
- Hexadecimal to decimal conversion.

Examples:

// Binary to decimal
int binaryNumber = 10000;
int decimalNumber = [BaseConverter BinaryToDecimal:binaryNumber]; // The result of the conversion is 16

// Decimal to binary
int decimalNumber = 16;
int binaryNumber = [BaseConverter DecimalToBinary:decimalNumber]; // The result of the conversion is 10000

// Decimal to hexadecimal
int decimalNumber = 255
NSString *hexadecimalNumber = [BaseConverter DecimalToHexadecimal:decimalNumber]; // The result of the conversion is ff

// Hexadecimal to decimal
int decimalNumber = [BaseConverter HexadecimalToDecimal:[NSString stringWithFormat:@"ff"]];  // The result of the conversion is 255

About

BaseConverter is a numeric base converter class.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published