shrink integers with php

function chr_enc$id ) {
        
$c 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        
$id = (string)$id;
        for( 
$i 0$i strlen$id ); $i++ ) {
                
$x .= $id{$i};
                if( 
$x && $x <= ( strlen$c ) + ) ) {
                        
$n .= $c{$x-10};
                        
$x '';
                }
                elseif( 
$x strlen$c ) + 10 || $x == '0' || $i == ( strlen$id ) - ) ) {
                        
$n .= $x;
                        
$x '';
                }
        }
        return 
$n;
}

function 
chr_dec$id ) {
        
$c 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        for( 
$i 0$i strlen$id ); $i++ ) {
                
$n .= ( !is_numeric$id{$i} ) ) ? ( strpos$c$id{$i} ) + 10 ) : $id{$i};
        }
        return 
$n;
}


example:
212408898 => lo08898
30028247 => u0so7
11222207 => bmm07
94070738 => 94070738
81071369 => 81071A9
197309119 => j73091j
15018738 => f0i738
78584770 => 78WL70
191854002 => jiS002
188192516 => i8192P6
65437343 => 65H73H
124061870 => cEZ870
207003851 => k700CP
218431612 => l84vZ2
5688664 => U88664
162528033 => gps0x
57489904 => VM9904
89269087 => 89q9087
193413083 => jyd083
144121183 => eFli3
218427866 => l84r866
57912246 => V91mK
229392376 => m9392B6
56443324 => UIxo
34996219 => y996219
147906071 => e790Y71
96379484 => 96B9484
109124765 => a91o765
89620478 => 89620L8


it's nothing special but it's useful, sometimes... have fun shrinking numbers ;)

Colophon

Donec ac nisi in lectus euismod sodales. Suspendisse congue, arcu sit amet adipiscing scelerisque, enim neque ullamcorper dolor, sed viverra erat leo eu metus. Cras porttitor bibendum nunc.

Syndicate

May 5th 2008
Tags: Offtopic

8 Comments

would you pay for a weekend with me?

I’m interested to know something. If you could, would you pay $5,000, not including flight and food, to get in a hotel with me for a weekend. Basically you get on a table with me and tell me what you’re doing (you can be as specific as you want). I’ll give you new ideas and ...
April 7th 2008
Tags: News

47 Comments

seoFM.com abused for shady and illegal blackhat methods - marcus t.’s true nature

aw, fuck it. don’t have the time to deal with that shit. - so far, threads, which have surfaced in forums regarding this topic, have been deleted by the request of mr. t. himself. he’s even arrogant enough to boast about having the owner of the abakus forum remove some threads over the phone. people who participate ...
March 16th 2008
Tags: Offtopic

3 Comments

great hotels

las vegas: chicago: mieming, austria:
March 9th 2008
Tags: Rediscoveries, Offtopic

No Comments

bit char-g is still available

can somebody remember bit char-g? those really tiny rc cars? those little cars are a hell lot of fun and because i found a site that sells those cars for a very low price i ordered a few of them including the stuff to build a track. - gundamstoreandmore.com have fun :D
March 5th 2008
Tags: News, Offtopic

4 Comments

how much can you earn as a blackhat?

people asking me this questions around 50 times a day... i'am a very visual person so let me answer this questions once and for all with pictures: if you don't trust me, visit me somewhere around 220 west 16th street, new york (chelsea). you know if you found me and if i'am at home if that ...

Search