public function oathTruncate($hash)
    {
        $offset = ord($hash[19]) & 0xf;

        $temp = unpack('N', substr($hash, $offset, 4));

        return substr(
            $temp[1] & 0x7fffffff,
            -$this->getOneTimePasswordLength()
        );
    }
public function oathTruncate($hash)
    {
        $offset = ord($hash[19]) & 0xf;

        $temp = unpack('N', substr($hash, $offset, 4));

        return substr(
            $temp[1] & 0x7fffffff,
            -$this->getOneTimePasswordLength()
        );
    }
public function oathTruncate ( $ hash ) { $ offset = ord ( $ hash [ 19 ] ) & 0xf ; $ temp = unpack ( 'N' , substr ( $ hash , $ offset , 4 ) ) ; return substr ( $ temp [ 1 ] & 0x7fffffff , - $ this -> getOneTimePasswordLength ( ) ) ; }
Extracts the OTP from the SHA1 hash.

@param string $hash

@return int
Extracts the OTP from the SHA1 hash .