相关疑难解决方法(0)

错误:无法找到vcvarsall.bat

我试图安装Python包dulwich:

pip install dulwich
Run Code Online (Sandbox Code Playgroud)

但我得到一个神秘的错误信息:

error: Unable to find vcvarsall.bat
Run Code Online (Sandbox Code Playgroud)

如果我尝试手动安装包,也会发生同样的情况:

> python setup.py install
running build_ext
building 'dulwich._objects' extension
error: Unable to find vcvarsall.bat
Run Code Online (Sandbox Code Playgroud)

python windows pip failed-installation setup.py

842
推荐指数
18
解决办法
87万
查看次数

在python中使用salt并哈希密码

这段代码应该用盐哈希密码.salt和哈希密码正在保存在数据库中.密码本身不是.

考虑到操作的敏感性,我想确保一切都是犹太洁食.

注意:我习惯使用url安全版的b64encode.

import hashlib
import base64
import uuid

password = 'test_password'
salt     = base64.urlsafe_b64encode(uuid.uuid4().bytes)


t_sha = hashlib.sha512()
t_sha.update(password+salt)
hashed_password =  base64.urlsafe_b64encode(t_sha.digest())
Run Code Online (Sandbox Code Playgroud)

python authentication passwords hash salt

75
推荐指数
7
解决办法
10万
查看次数

尝试在Windows上安装Python bcrypt的许多问题(x64)

这个问题已在其他地方提到,但它没有提供可行的解决方案,所以我仍然希望打开一张票.

c:\Users\me\Desktop\temp\py-bcrypt-0.2>setup.py install build --compiler=min
gw32
running install
running build
running build_py
running build_ext
building 'bcrypt._bcrypt' extension
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c bcrypt/bcrypt_python.c -o build\temp.win32-2.7\Release\bcrypt\bcrypt_python.o
bcrypt/bcrypt_python.c:29:26: error: expected declaration specifiers or '...' before 'u_int8_t'
bcrypt/bcrypt_python.c:29:38: error: expected declaration specifiers or '...' before 'u_int16_t'
bcrypt/bcrypt_python.c:29:49: error: expected declaration specifiers or '...' before 'u_int8_t'
bcrypt/bcrypt_python.c: In function 'bcrypt_encode_salt':
bcrypt/bcrypt_python.c:56:2: error: too many arguments to function 'encode_salt'

bcrypt/bcrypt_python.c:29:6: note: declared here
error: command 'gcc' failed with exit …

python windows windows-7 windows64

5
推荐指数
1
解决办法
2125
查看次数