We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问trx或eth的私钥跟哈希如何用正则(php)区分出来?
The text was updated successfully, but these errors were encountered:
可以使用正则表达式来区分 TRX 或 ETH 的私钥和哈希。以下是两种方法:
方法一:使用长度
TRX 私钥的长度为 64 个字符,而 ETH 私钥的长度为 66 个字符。哈希的长度通常为 64 个字符,但也可以是其他长度。因此,可以使用以下正则表达式来区分它们:
` $regex = '/^[0-9a-f]{64}$/';
if (preg_match($regex, $string)) { // 可能是 TRX 私钥或哈希 } else if (strlen($string) === 66) { // 可能是 ETH 私钥 } else { // 不是 TRX 或 ETH 私钥或哈希 } `
Sorry, something went wrong.
No branches or pull requests
请问trx或eth的私钥跟哈希如何用正则(php)区分出来?
The text was updated successfully, but these errors were encountered: