Home > Backend Development > PHP Tutorial > node.js - 如何在Nodejs中实现PHP crypt()函数

node.js - 如何在Nodejs中实现PHP crypt()函数

WBOY
Release: 2016-06-06 20:41:31
Original
1338 people have browsed it

后端密码存储是通过crypt函数+salt,如下:

<code>pwd = crypt(value ,salt)
</code>
Copy after login
Copy after login

salt的格式是$2a$08$aabbccddee,所以加密算法应该是blowfish,那么问题来了,怎样在Nodejs中实现crypt函数?

回复内容:

后端密码存储是通过crypt函数+salt,如下:

<code>pwd = crypt(value ,salt)
</code>
Copy after login
Copy after login

salt的格式是$2a$08$aabbccddee,所以加密算法应该是blowfish,那么问题来了,怎样在Nodejs中实现crypt函数?

npm上有blowfish这个包,看下生成的结果是不是跟你说的crypt的结果一致?

给力!!!!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template