mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
ASN1: little optimization for better performance.
This commit is contained in:
parent
c1c9c38fe6
commit
64c3b309bd
@ -241,6 +241,11 @@ class File_ASN1 {
|
|||||||
*/
|
*/
|
||||||
function decodeBER($encoded)
|
function decodeBER($encoded)
|
||||||
{
|
{
|
||||||
|
if (is_object($encoded) && strtolower(get_class($encoded)) == 'file_asn1_element') {
|
||||||
|
$encoded = $encoded->element;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->encoded = $encoded;
|
||||||
return $this->_decode_ber($encoded);
|
return $this->_decode_ber($encoded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,14 +265,6 @@ class File_ASN1 {
|
|||||||
{
|
{
|
||||||
$decoded = array();
|
$decoded = array();
|
||||||
|
|
||||||
if (is_object($encoded) && strtolower(get_class($encoded)) == 'file_asn1_element') {
|
|
||||||
$encoded = $encoded->element;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($start == 0) {
|
|
||||||
$this->encoded = $encoded;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ( strlen($encoded) ) {
|
while ( strlen($encoded) ) {
|
||||||
$current = array('start' => $start);
|
$current = array('start' => $start);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user