Hirdetés
- Merész dizájn és új teleobjektív az iPhone 17 Pro mobilokban
- Mobil flották
- Vivo X200 Pro - a kétszázát!
- Samsung Galaxy S22 Ultra - na, kinél van toll?
- Fotók, videók mobillal
- iPhone topik
- Milyen okostelefont vegyek?
- Szemtelenül olcsó lett a Nubia Fold
- Honor Magic6 Pro - kör közepén számok
- Samsung Galaxy Watch8 - Classic - Ultra 2025
Új hozzászólás Aktív témák
-
ekkold
őstag
Hasonlót gyártottam én is, persze jelszavas védelemmel kiegészítve.
Több kulcsot kezel, és egy táblázatban jeleníti meg, valahogy így:
Hogy ne kelljen külső dekódert használni azt is beemeltem a php kódba:
$map = array(
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23
'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31
'=' // padding char
);
$flippedMap = array(
'A'=>'0', 'B'=>'1', 'C'=>'2', 'D'=>'3', 'E'=>'4', 'F'=>'5', 'G'=>'6', 'H'=>'7',
'I'=>'8', 'J'=>'9', 'K'=>'10', 'L'=>'11', 'M'=>'12', 'N'=>'13', 'O'=>'14', 'P'=>'15',
'Q'=>'16', 'R'=>'17', 'S'=>'18', 'T'=>'19', 'U'=>'20', 'V'=>'21', 'W'=>'22', 'X'=>'23',
'Y'=>'24', 'Z'=>'25', '2'=>'26', '3'=>'27', '4'=>'28', '5'=>'29', '6'=>'30', '7'=>'31'
);
function decode($input) {
global $map;
global $flippedMap;
if(empty($input)) return;
$paddingCharCount = substr_count($input, $map[32]);
$allowedValues = array(6,4,3,1,0);
if(!in_array($paddingCharCount, $allowedValues)) return false;
for($i=0; $i<4; $i++){
if($paddingCharCount == $allowedValues[$i] &&
substr($input, -($allowedValues[$i])) != str_repeat($map[32], $allowedValues[$i])) return false;
}
$input = str_replace('=','', $input);
$input = str_split($input);
$binaryString = "";
for($i=0; $i < count($input); $i = $i+8) {
$x = "";
if(!in_array($input[$i], $map)) return false;
for($j=0; $j < 8; $j++) {
$x .= str_pad(base_convert($flippedMap[@$input[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
}
$eightBits = str_split($x, 8);
for($z = 0; $z < count($eightBits); $z++) {
$binaryString .= ( ($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48 ) ? $y:"";
}
}
return $binaryString;
}//fv
/*
function encode($input, $padding = true) {
global $map;
global $flippedMap;
if(empty($input)) return "";
$input = str_split($input);
$binaryString = "";
for($i = 0; $i < count($input); $i++) {
$binaryString .= str_pad(base_convert(ord($input[$i]), 10, 2), 8, '0', STR_PAD_LEFT);
}
$fiveBitBinaryArray = str_split($binaryString, 5);
$base32 = "";
$i=0;
while($i < count($fiveBitBinaryArray)) {
$base32 .= $map[base_convert(str_pad($fiveBitBinaryArray[$i], 5,'0'), 2, 10)];
$i++;
}
if($padding && ($x = strlen($binaryString) % 40) != 0) {
if($x == 8) $base32 .= str_repeat($map[32], 6);
else if($x == 16) $base32 .= str_repeat($map[32], 4);
else if($x == 24) $base32 .= str_repeat($map[32], 3);
else if($x == 32) $base32 .= $map[32];
}
return $base32;
}
*/
Új hozzászólás Aktív témák
- sziku69: Szólánc.
- PlayStation 5
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- EAFC 26
- Merész dizájn és új teleobjektív az iPhone 17 Pro mobilokban
- Mobil flották
- Videó stream letöltése
- One otthoni szolgáltatások (TV, internet, telefon)
- Vivo X200 Pro - a kétszázát!
- Robotporszívók
- További aktív témák...
- Apple iPhone 12 Pro / 128GB / Kártyafüggetlen / 12Hó Garancia
- HP ProDesk 600 G4 i5-8100 16GB 512GB 1 év garancia
- Lenovo Legion Y540 - 15.6"FHD IPS 144Hz - i7 9750H - 16GB - 256GB SSD+1TB HDD - Win11 - GTX 1660 Ti
- GYÖNYÖRŰ iPhone 15 Pro Max 512GB Black Titanium -1 ÉV GARANCIA - Kártyafüggetlen, MS3867, 100% Akksi
- Tmactime MWS-001 elektromos rovarcsapda / 12 hó jótállás
Állásajánlatok
Cég: BroadBit Hungary Kft.
Város: Budakeszi
Cég: ATW Internet Kft.
Város: Budapest



