Skip to content

Commit

Permalink
Update Encryptor.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Player626 authored and RunsTp committed Nov 18, 2020
1 parent 982e490 commit 5ae7eba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/OfficialAccount/Encryptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static function encodePKCS($data, $blockSize = 32)
public static function decodePKCS($data)
{
// 根据PKCS 补位时如果为整数倍块大小 则补上块大小个字节的补位 最后一位必是补位字节
$pad = ord($data{strlen($data) - 1});
$pad = ord($data[strlen($data) - 1]);
if ($pad > strlen($data)) {
return false;
}
Expand All @@ -161,4 +161,4 @@ public static function decodePKCS($data)
}
return substr($data, 0, -1 * $pad);
}
}
}

0 comments on commit 5ae7eba

Please sign in to comment.