Example #1
0
 /**
  * decode the encoded id
  * 
  * @param type string|array $id
  * @return string|array
  */
 protected function decode($id)
 {
     $tiny = new \ZackKitzmiller\Tiny($this->salt);
     if (is_array($id)) {
         $decodedId = [];
         foreach ($id as $name => $encodedId) {
             $decodedId[$name] = $tiny->from($encodedId);
         }
         return $decodedId;
     }
     return $tiny->from($id);
 }
Example #2
0
 /**
  * decode the encoded id
  * 
  * @param type string|array $id
  * @return string|array
  */
 public static function decode($id)
 {
     $tiny = new \ZackKitzmiller\Tiny(self::$salt);
     if (is_array($id)) {
         $decodedId = [];
         foreach ($id as $name => $encodedId) {
             $decodedId[$name] = $tiny->from($encodedId);
         }
         return $decodedId;
     }
     return $tiny->from($id);
 }