今回は、
Hash Info
からです。
Hash Info
ハッシュ情報
The characters that comprise the resultant hash are
結果のハッシュを構成する文字は、次のとおりです。
./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789$.
Resultant hashes will be 60 characters long and they will include the salt among other parameters, as follows:
結果のハッシュは60文字の長さになり、次のように他のパラメータの中にsaltが含まれます。
$[algorithm]$[cost]$[salt][hash]
・2 chars hash algorithm identifier prefix. "$2a$" or "$2b$" indicates BCrypt
2文字のハッシュアルゴリズム識別子プレフィクス。「$2a$」または「$20億$」はBCryptを示す
・Cost-factor (n). Represents the exponent used to determine how many iterations 2^n
費用係数(n)。反復回数を決定するために使用される指数を表します2^n
・16-byte (128-bit) salt, base64 encoded to 22 characters
16バイト(128ビット)salt、base64を22文字にエンコード
・24-byte (192-bit) hash, base64 encoded to 31 characters
24バイト(192ビット)のハッシュ、base64を31文字にエンコード
Example:
$2b$10$nOUIs5kJ7naTuTFkBy1veuK0kSxUFXfuaOKdOKf9xYT0KKIGSJwFa
| | | |
| | | hash-value = K0kSxUFXfuaOKdOKf9xYT0KKIGSJwFa
| | |
| | salt = nOUIs5kJ7naTuTFkBy1veu
| |
| cost-factor => 10 = 2^10 rounds
|
hash-algorithm identifier => 2b = BCrypt
Testing
If you create a pull request, tests better pass :)
プルリクエストを作成した場合、テストは合格する方が良い:)
npm install
npm test
Credits
クレジット
The code for this comes from a few sources:
このためのコードは、いくつかのソースから来ています。
blowfish.cc - OpenBSD
bcrypt.cc - OpenBSD
bcrypt::gen_salt - gen_salt inclusion to bcrypt
bcrypt_node.cc - me
以上です。