nsx_doDecode

The NextScripts: Social Networks Auto-Poster nsx doDecode function.

Description

nsx_doDecode( $string, (string) $key = 'NSX' ); 

Parameters (2)

0. $string
The string.
1. $key — Optional. (string) => 'NSX'
The key.

Usage

  1. if ( !function_exists( 'nsx_doDecode' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextscripts-social-networks-auto-poster/nxs_functions.php'; 
  3.  
  4. // The string. 
  5. $string = null; 
  6.  
  7. // The key. 
  8. $key = 'NSX'; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = nsx_doDecode($string, $key); 
  12.  

Defined (1)

The function is defined in the following location(s).

/nxs_functions.php  
  1. if (!function_exists('nsx_doDecode')) { function nsx_doDecode($string, $key='NSX') { $key = sha1($key); $keyLen = strlen($key); $hash = ''; $sX = str_split($string, 2560); 
  2. foreach($sX as $ss) {$j=0; $sA=str_split($ss, 2); foreach($sA as $oS) {$oS=hexdec(base_convert(strrev($oS), 36, 16)); if ($j==$keyLen) $j=0; $oK=ord(substr($key, $j, 1)); $j++; $hash.=chr($oS-$oK);}} return $hash; 
  3. }}