Skip to content

Instantly share code, notes, and snippets.

@tbxark
Last active February 25, 2025 13:05
Show Gist options
  • Select an option

  • Save tbxark/4d24d55d2215030f3bc4d4fd32a32dca to your computer and use it in GitHub Desktop.

Select an option

Save tbxark/4d24d55d2215030f3bc4d4fd32a32dca to your computer and use it in GitHub Desktop.
ChatGPT IP 风险解析
function parseDifficulty(difficulty) {
const cleanDifficulty = difficulty.replace('0x', '').replace(/^0+/, '');
const hexLength = cleanDifficulty.length;
const hex2num = parseInt(cleanDifficulty, 16); // 将十六进制字符串转换为数字
if (hexLength <= 2) {
level = '(困难)';
qualityText = '高风险';
} else if (hexLength === 3) {
level = '(中等)';
qualityText = '中等';
} else if (hexLength === 4) {
level = '(简单)';
qualityText = '良好';
} else {
level = '(极易)';
qualityText = '优秀';
}
console.log("难度值:", hex2num, "\t这个值越小,代表PoW难度越高,ChatGPT认为你的IP风险越高。")
console.log("难度等级:", level)
console.log("IP质量:", qualityText)
}
parseDifficulty("03eaa2")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment