ledbits.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ClockBlocker 作者: pinheadmz 项目源码 文件源码
def getUserAgentColor(subver):
    '''
    userAgent = subver.lower()
    if "classic" in userAgent:
        color = COLOR_GOLD
    elif "unlimited" in userAgent:
        color = COLOR_LTBLUE
    elif "xt" in userAgent:
        color = COLOR_GREEN
    elif "satoshi" not in userAgent:
        color = COLOR_RED
    else:
        color = COLOR_WHITE

    return color
    '''
    hash = hashlib.sha256(subver).hexdigest()
    return curses.color_pair((int(hash[10:20], 16) % 7) + 1)

# turn any arbitrary string into a (r, g, b) color via hash
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号