Recommend this page to a friend! |
Download .zip |
Info | Screenshots | View files (3) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2010-09-30 (6 years ago) | Not enough user ratings | Total: 267 | All time: 7,261 This week: 1,109 |
Version | License | PHP version | Categories | |||
x-base 1.0 | GNU General Publi... | 5 | PHP 5, Math |
Description | Author | |
This class can be used to convert numbers between different numeric bases. |
coded by uwe stein Copyright (C) 2010 Uwe Stein hints, suggestions and bug reports are welcome. Here is a small overview how to use the x_base object ---------------------------------------------------------------Class mebers:--------------------------------------------------- alnum_digit = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" default use upper case letters num the umber encoded with base base the used base ( bin, dec,..., oct, ... hex, ... ) max_base the maximum base = strlen( $this->alnum_digit ); dec_num this always keeps the decimal Value of num ----------------------------------------------------------- public functions -------------------------------------------------- public function __construct($num,$base=10) param : $num = the number ( endoded with base ), [$base] the used base public function getNum() param : none return : the the encoded value public function getDec() param : none return : the decimal value of num public function getBase() param : none return : the used base public function getMaxBase() param : none return : the highest valid value for base public function toUpper() param : none return : none purpose: changes the digit-set to upper Letters public function toLower() param : none return : none purpose: changes the digit-set to upper Letters public function mixedDigits() param : none return : none purpose: changes the digit-set to upper and lower Letters note : "01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" with mixed set the "A" and "a" represent different values public function getConvNum($base) param : the base to encode the number return : string with the encoded number purpose: retrieve a number encoded with bas note : the func doesnt change(restores) the values of class members public function setNum($value,$base=10) param : $num = the number ( endoded with base ), [$base] the used base return : none purpose: change the values of an existing object public function setBase($base) param : the new base return : none purpose: change the used base ( and rebuild the encoded number ) |
Screenshots | ||
Files |
File | Role | Description |
---|---|---|
readme.txt | Doc. | small documentation |
test_x_base.php | Example | some examples |
x_base.php | Class | the objekt-class |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.