Skip to content

Commit

Permalink
Add Util helper
Browse files Browse the repository at this point in the history
  • Loading branch information
irazasyed committed May 11, 2023
1 parent 9086699 commit 599bcdb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Helpers/Util.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Telegram\Bot\Helpers;

use Illuminate\Support\Str;

final class Util
{
public static function secretToken(string $token): string
{
return Str::after($token, ':');
}

public static function isSecretTokenValid(string $token, string $secretToken): bool
{
return hash_equals(self::secretToken($token), $secretToken);
}
}

0 comments on commit 599bcdb

Please sign in to comment.