使用 PyNaCl 库: import nacl.bindings # scalar multiplication: curve25519_key * public pin_key = nacl.bindings.crypto_scalarmult(curve25519_key, pin_token_bytes)
使用 PyNaCl 这个库:pip install PyNaCl import nacl.bindings # ed25519 to curve25519 curve25519_key = nacl.bindings.crypto_sign_ed25519_sk_to_curve25519(private_key) # scalar multiplication: curve25519_key * public pin_key = nacl.bindings.crypto_scalarmult(curve25519_key, pin_token_bytes)
某个 collection 的所有 tags {% assign tags = '' | split: ',' %} {% for doc in collection.docs %} {% assign tags = tags | concat: doc.tags %} {% endfor %} {% assign tags = tags | uniq %}
系统自动功能, 截屏到剪切板,截屏到文件。 基本的全屏截图、手动框选自定义区域截图。 shottr (好用) 可免费使用(会提醒购买授权)。除了基本的全屏、手动
自动自带的 “Digital Color Meter” 鼠标移到要取的颜色上,再按 Shift + Command + C 就可以复制十六进制颜色值到剪切板 Pixeur 免费。用起来更方便和舒适。
不涉及本地化'{:,}'.format(value) # For Python ≥2.7 f'{value:,}' # For Python ≥3.6 涉及本地化import locale locale.setlocale(locale.LC_ALL, '') # '' 空字符自动
🔍搜索框快捷键:Ctrl + K 使用类 Unix 搜索命令语法。 例如搜索包含 hello 和 world 的文章:'hello 'world 语法详情: 空格充当**逻辑与(AND)**操作符,
用浏览器请求 REST API,发现浏览器端总是报错:no ‘Access-Control-Allow-Origin’ header。但是 Postman 里请求 API 是正常的。 这是因为浏览器跨域请求 API,发现服务器不支持 COR
这篇文章说的是升级更新 pip 自身。 如果是需要通过 pip 管理和更新 Python 软件包,请参考 pip 的使用。 若 pip 是安装 Python 是自带的,更新方式: python3 -m pip install --upgrade pip 手动独立安装的
匹配一个词:(?:word) 匹配多个词:(?:word|word2) 前面加?:是不捕获元组 举例: (?:apple|orange),匹配单词“