src/LINEBot/SignatureValidator.php
public static function validateSignature($body, $channelSecret, $signature)
    {
        if (!isset($signature)) {
            throw new InvalidSignatureException('Signature must not be empty');
        }

        return hash_equals(base64_encode(hash_hmac('sha256', $body, $channelSecret, true)), $signature);
    }
public static function validateSignature($body, $channelSecret, $signature)
    {
        if (!isset($signature)) {
            throw new InvalidSignatureException('Signature must not be empty');
        }

        return hash_equals(base64_encode(hash_hmac('sha256', $body, $channelSecret, true)), $signature);
    }
public static function validateSignature ( $ body , $ channelSecret , $ signature ) { if ( ! isset ( $ signature ) ) { throw new InvalidSignatureException ( 'Signature must not be empty' ) ; } return hash_equals ( base64_encode ( hash_hmac ( 'sha256' , $ body , $ channelSecret , true ) ) , $ signature ) ; }
Validate request with signature.

@param string $body Request body.
@param string $channelSecret Your channel secret.
@param string $signature Signature (probably retrieve from HTTP header).
@return bool Request is valid or not.
@throws InvalidSignatureException When empty signature is given.
Validate request with signature .