This commit is contained in:
tanner0101 2017-05-22 11:20:53 +01:00
parent 179ae0fe91
commit 922d83b8fb
4 changed files with 81 additions and 81 deletions

View File

@ -572,7 +572,7 @@
},
{
"location": "/vapor/hash/",
"text": "Hash\n\n\nHashing is a one way method of converting arbitrary data into a fixed size format. Unlike ciphers, data that is hashed cannot be retrieved from the resulting digest. Hashes can be used to create keys, file identifiers, or store credentials.\n\n\n\n\n\n\nHash function diagram from \nWikipedia\n.\n\n\n\n\n\n\nWarning\n\n\nAvoid storing password hashes if possible. If you must, please make sure to research the state of the art before continuing.\n\n\n\n\nMake\n\n\nTo hash a string, use the \nhash\n property on \nDroplet\n.\n\n\nlet\n \ndigest\n \n=\n \ntry\n \ndrop\n.\nhash\n.\nmake\n(\nvapor\n)\n\n\nprint\n(\ndigest\n.\nstring\n)\n\n\n\n\n\n\nChecking\n\n\nSome hashing algorithms create different hash digests for the same message. Because of this, it is necessary to check your hashes using the \ncheck\n method.\n\n\nlet\n \nmatches\n \n=\n \ntry\n \ndrop\n.\nhash\n.\ncheck\n(\nvapor\n,\n \nmatchesHash\n:\n \ndigest\n)\n\n\n\n\n\n\nCryptoHasher\n\n\nBy default, Vapor uses a SHA-256 hasher. You can change this in the configuration files or by giving the \nDroplet\n a different hasher.\n\n\nConfiguration\n\n\nConfig/droplet.json\n\n\n{\n\n \n...,\n\n \nhash\n:\n \ncrypto\n,\n\n \n...\n\n\n}\n\n\n\n\n\n\nConfig/crypto.json\n\n\n{\n\n \nhash\n:\n \n{\n\n \nmethod\n:\n \nsha256\n,\n\n \nencoding\n:\n \nhex\n,\n\n \nkey\n:\n \npassword\n\n \n},\n\n \n...\n\n\n}\n\n\n\n\n\n\nEncoding\n\n\nThe CryptoHasher supports three methods of encoding.\n\n\n\n\nhex\n\n\nbase64\n\n\nplain\n\n\n\n\nKey\n\n\nSupplying a key will cause the hasher to produce \nkeyed\n hashes using HMAC. Some hashers require a key.\n\n\nSupported\n\n\n\n\n\n\n\n\nName\n\n\nMethod\n\n\nRequires Key\n\n\n\n\n\n\n\n\n\n\nSHA-1\n\n\nsha1\n\n\nno\n\n\n\n\n\n\nSHA-224\n\n\nsha224\n\n\nno\n\n\n\n\n\n\nSHA-256\n\n\nsha256\n\n\nno\n\n\n\n\n\n\nSHA-384\n\n\nsha384\n\n\nno\n\n\n\n\n\n\nSHA-512\n\n\nsha512\n\n\nno\n\n\n\n\n\n\nMD4\n\n\nmd4\n\n\nno\n\n\n\n\n\n\nMD5\n\n\nmd5\n\n\nno\n\n\n\n\n\n\nRIPEMD-160\n\n\nripemd160\n\n\nno\n\n\n\n\n\n\nWhirlpool\n\n\nwhirlpool\n\n\nyes\n\n\n\n\n\n\nStreebog-256\n\n\nstreebog256\n\n\nyes\n\n\n\n\n\n\nStreebog-512\n\n\nstreebog512\n\n\nyes\n\n\n\n\n\n\nGostR341194\n\n\ngostr341194\n\n\nyes\n\n\n\n\n\n\n\n\nManual\n\n\nHashers can be swapped without the use of configuration files.\n\n\nHash\n\n\nlet\n \nhash\n \n=\n \nCryptoHasher\n(\n\n \nhash\n:\n \n.\nsha256\n,\n\n \nencoding\n:\n \n.\nhex\n\n\n)\n\n\n\nlet\n \ndrop\n \n=\n \ntry\n \nDroplet\n(\nhash\n:\n \nhash\n)\n\n\n\n\n\n\nHMAC\n\n\nlet\n \nhash\n \n=\n \nCryptoHasher\n(\n\n \nhmac\n:\n \n.\nsha256\n,\n\n \nencoding\n:\n \n.\nhex\n,\n\n \nkey\n:\n \npassword\n.\nmakeBytes\n()\n\n\n)\n\n\n\nlet\n \ndrop\n \n=\n \ntry\n \nDroplet\n(\nhash\n:\n \nhash\n)\n\n\n\n\n\n\nBCryptHasher\n\n\nBCrypt is a password hashing function that automatically incorporates salts and offers a configurable work factor. The work factor can be used to increase the computation required to generate a hash.\n\n\n\n\nSeealso\n\n\nLearn more about \nkey stretching\n on Wikipedia.\n\n\n\n\nConfiguration\n\n\nTo use the BCryptHasher change the \n\"hash\"\n key in the \ndroplet.json\n configuration file.\n\n\nConfig/droplet.json\n\n\n{\n\n \n...,\n\n \nhash\n:\n \nbcrypt\n,\n\n \n...\n\n\n}\n\n\n\n\n\n\nTo configure the work factor, add a \nbcrypt.json\n file.\n\n\nConfig/bcrypt.json\n\n\n{\n\n \nworkFactor\n:\n \n8\n\n\n}\n\n\n\n\n\n\n\n\nTip\n\n\nYou can use different BCrypt work factors for production and development modes to keep password hashing fast while working on a project.\n\n\n\n\nManual\n\n\nYou can manually assign a \nBCryptHasher\n to \ndrop.hash\n.\n\n\nlet\n \nhash\n \n=\n \nBCryptHasher\n(\nworkFactor\n:\n \n8\n)\n\n\n\nlet\n \ndrop\n \n=\n \ntry\n \nDroplet\n(\nhash\n:\n \nhash\n)\n\n\n\n\n\n\nAdvanced\n\n\nCustom\n\n\nYou can also create your own hasher. You just need to conform to the \nHash\n protocol.\n\n\n/// Creates hash digests\n\n\npublic\n \nprotocol\n \nHashProtocol\n \n{\n\n \n/// Given a message, this method\n\n \n/// returns a hashed digest of that message.\n\n \nfunc\n \nmake\n(\n_\n \nmessage\n:\n \nBytes\n)\n \nthrows\n \n-\n \nBytes\n\n\n \n/// Checks whether a given digest was created\n\n \n/// by the supplied message.\n\n \n///\n\n \n/// Returns true if the digest was created\n\n \n/// by the supplied message, false otherwise.\n\n \nfunc\n \ncheck\n(\n_\n \nmessage\n:\n \nBytes\n,\n \nmatchesHash\n:\n \nBytes\n)\n \nthrows\n \n-\n \nBool\n\n\n}",
"text": "Hash\n\n\nHashing is a one way method of converting arbitrary data into a fixed size format. Unlike ciphers, data that is hashed cannot be retrieved from the resulting digest. Hashes can be used to create keys, file identifiers, or store credentials.\n\n\n\n\n\n\nHash function diagram from \nWikipedia\n.\n\n\n\n\n\n\nWarning\n\n\nAvoid storing password hashes if possible. If you must, please make sure to research the state of the art before continuing.\n\n\n\n\nMake\n\n\nTo hash a string, use the \nhash\n property on \nDroplet\n.\n\n\nlet\n \ndigest\n \n=\n \ntry\n \ndrop\n.\nhash\n.\nmake\n(\nvapor\n)\n\n\nprint\n(\ndigest\n.\nstring\n)\n\n\n\n\n\n\nChecking\n\n\nSome hashing algorithms create different hash digests for the same message. Because of this, it is necessary to check your hashes using the \ncheck\n method.\n\n\nlet\n \nmatches\n \n=\n \ntry\n \ndrop\n.\nhash\n.\ncheck\n(\nvapor\n,\n \nmatchesHash\n:\n \ndigest\n)\n\n\n\n\n\n\nCryptoHasher\n\n\nBy default, Vapor uses a SHA-256 hasher. You can change this in the configuration files or by giving the \nDroplet\n a different hasher.\n\n\nConfiguration\n\n\nConfig/droplet.json\n\n\n{\n\n \n...,\n\n \nhash\n:\n \ncrypto\n,\n\n \n...\n\n\n}\n\n\n\n\n\n\nConfig/crypto.json\n\n\n{\n\n \nhash\n:\n \n{\n\n \nmethod\n:\n \nsha256\n,\n\n \nencoding\n:\n \nhex\n,\n\n \nkey\n:\n \npassword\n\n \n},\n\n \n...\n\n\n}\n\n\n\n\n\n\nEncoding\n\n\nThe CryptoHasher supports three methods of encoding.\n\n\n\n\nhex\n\n\nbase64\n\n\nplain\n\n\n\n\nKey\n\n\nSupplying a key will cause the hasher to produce \nkeyed\n hashes using HMAC. Some hashers require a key.\n\n\nSupported\n\n\n\n\n\n\n\n\nName\n\n\nMethod\n\n\nRequires Key\n\n\n\n\n\n\n\n\n\n\nSHA-1\n\n\nsha1\n\n\nno\n\n\n\n\n\n\nSHA-224\n\n\nsha224\n\n\nno\n\n\n\n\n\n\nSHA-256\n\n\nsha256\n\n\nno\n\n\n\n\n\n\nSHA-384\n\n\nsha384\n\n\nno\n\n\n\n\n\n\nSHA-512\n\n\nsha512\n\n\nno\n\n\n\n\n\n\nMD4\n\n\nmd4\n\n\nno\n\n\n\n\n\n\nMD5\n\n\nmd5\n\n\nno\n\n\n\n\n\n\nRIPEMD-160\n\n\nripemd160\n\n\nno\n\n\n\n\n\n\nWhirlpool\n\n\nwhirlpool\n\n\nyes\n\n\n\n\n\n\nStreebog-256\n\n\nstreebog256\n\n\nyes\n\n\n\n\n\n\nStreebog-512\n\n\nstreebog512\n\n\nyes\n\n\n\n\n\n\nGostR341194\n\n\ngostr341194\n\n\nyes\n\n\n\n\n\n\n\n\nManual\n\n\nHashers can be swapped without the use of configuration files.\n\n\nHash\n\n\nlet\n \nhash\n \n=\n \nCryptoHasher\n(\n\n \nhash\n:\n \n.\nsha256\n,\n\n \nencoding\n:\n \n.\nhex\n\n\n)\n\n\n\nlet\n \ndrop\n \n=\n \ntry\n \nDroplet\n(\nhash\n:\n \nhash\n)\n\n\n\n\n\n\nHMAC\n\n\nlet\n \nhash\n \n=\n \nCryptoHasher\n(\n\n \nhmac\n:\n \n.\nsha256\n,\n\n \nencoding\n:\n \n.\nhex\n,\n\n \nkey\n:\n \npassword\n.\nmakeBytes\n()\n\n\n)\n\n\n\nlet\n \ndrop\n \n=\n \ntry\n \nDroplet\n(\nhash\n:\n \nhash\n)\n\n\n\n\n\n\nBCryptHasher\n\n\nBCrypt is a password hashing function that automatically incorporates salts and offers a configurable cost. The cost can be used to increase the computation required to generate a hash.\n\n\n\n\nSeealso\n\n\nLearn more about \nkey stretching\n on Wikipedia.\n\n\n\n\nConfiguration\n\n\nTo use the BCryptHasher change the \n\"hash\"\n key in the \ndroplet.json\n configuration file.\n\n\nConfig/droplet.json\n\n\n{\n\n \n...,\n\n \nhash\n:\n \nbcrypt\n,\n\n \n...\n\n\n}\n\n\n\n\n\n\nTo configure the cost, add a \nbcrypt.json\n file.\n\n\nConfig/bcrypt.json\n\n\n{\n\n \ncost\n:\n \n8\n\n\n}\n\n\n\n\n\n\n\n\nTip\n\n\nYou can use different BCrypt costs for production and development modes to keep password hashing fast while working on a project.\n\n\n\n\nManual\n\n\nYou can manually assign a \nBCryptHasher\n to \ndrop.hash\n.\n\n\nlet\n \nhash\n \n=\n \nBCryptHasher\n(\ncost\n:\n \n8\n)\n\n\n\nlet\n \ndrop\n \n=\n \ntry\n \nDroplet\n(\nhash\n:\n \nhash\n)\n\n\n\n\n\n\nAdvanced\n\n\nCustom\n\n\nYou can also create your own hasher. You just need to conform to the \nHash\n protocol.\n\n\n/// Creates hash digests\n\n\npublic\n \nprotocol\n \nHashProtocol\n \n{\n\n \n/// Given a message, this method\n\n \n/// returns a hashed digest of that message.\n\n \nfunc\n \nmake\n(\n_\n \nmessage\n:\n \nBytes\n)\n \nthrows\n \n-\n \nBytes\n\n\n \n/// Checks whether a given digest was created\n\n \n/// by the supplied message.\n\n \n///\n\n \n/// Returns true if the digest was created\n\n \n/// by the supplied message, false otherwise.\n\n \nfunc\n \ncheck\n(\n_\n \nmessage\n:\n \nBytes\n,\n \nmatchesHash\n:\n \nBytes\n)\n \nthrows\n \n-\n \nBool\n\n\n}",
"title": "Hash"
},
{
@ -632,17 +632,17 @@
},
{
"location": "/vapor/hash/#bcrypthasher",
"text": "BCrypt is a password hashing function that automatically incorporates salts and offers a configurable work factor. The work factor can be used to increase the computation required to generate a hash. Seealso Learn more about key stretching on Wikipedia.",
"text": "BCrypt is a password hashing function that automatically incorporates salts and offers a configurable cost. The cost can be used to increase the computation required to generate a hash. Seealso Learn more about key stretching on Wikipedia.",
"title": "BCryptHasher"
},
{
"location": "/vapor/hash/#configuration_1",
"text": "To use the BCryptHasher change the \"hash\" key in the droplet.json configuration file. Config/droplet.json { \n ..., \n hash : bcrypt , \n ... } To configure the work factor, add a bcrypt.json file. Config/bcrypt.json { \n workFactor : 8 } Tip You can use different BCrypt work factors for production and development modes to keep password hashing fast while working on a project.",
"text": "To use the BCryptHasher change the \"hash\" key in the droplet.json configuration file. Config/droplet.json { \n ..., \n hash : bcrypt , \n ... } To configure the cost, add a bcrypt.json file. Config/bcrypt.json { \n cost : 8 } Tip You can use different BCrypt costs for production and development modes to keep password hashing fast while working on a project.",
"title": "Configuration"
},
{
"location": "/vapor/hash/#manual_1",
"text": "You can manually assign a BCryptHasher to drop.hash . let hash = BCryptHasher ( workFactor : 8 ) let drop = try Droplet ( hash : hash )",
"text": "You can manually assign a BCryptHasher to drop.hash . let hash = BCryptHasher ( cost : 8 ) let drop = try Droplet ( hash : hash )",
"title": "Manual"
},
{

View File

@ -1622,7 +1622,7 @@
<p>Traditional web frameworks leave room for error in routing by using strings for route parameter names and types. Vapor takes advantage of Swift's closures to provide a safer and more intuitive method for accessing route parameters.</p>
<div class="admonition seealso">
<p class="admonition-title">Seealso</p>
<p>Route parameters refer to segments of the URL path (e.g., <code>/users/:id</code>). For query parameters (e.g., <code>?foo=bar</code>) see <a href="../../http/request#query-parameters">request query parameters</a>.</p>
<p>Route parameters refer to segments of the URL path (e.g., <code>/users/:id</code>). For query parameters (e.g., <code>?foo=bar</code>) see <a href="../../http/request/#query-parameters">request query parameters</a>.</p>
</div>
<h2 id="type-safe">Type Safe<a class="headerlink" href="#type-safe" title="Permanent link">&para;</a></h2>
<p>To create a type safe route simply replace one of the parts of your path with a <code>Type</code>.</p>

View File

@ -4,7 +4,7 @@
<url>
<loc>/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -13,37 +13,37 @@
<url>
<loc>/getting-started/install-on-macos/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/getting-started/install-on-ubuntu/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/getting-started/toolbox/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/getting-started/hello-world/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/getting-started/manual/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/getting-started/xcode/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -53,49 +53,49 @@
<url>
<loc>/vapor/folder-structure/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/vapor/droplet/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/vapor/views/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/vapor/controllers/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/vapor/provider/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/vapor/hash/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/vapor/log/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/vapor/commands/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -105,7 +105,7 @@
<url>
<loc>/configs/config/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -115,13 +115,13 @@
<url>
<loc>/json/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/json/overview/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -131,31 +131,31 @@
<url>
<loc>/routing/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/routing/overview/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/routing/parameters/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/routing/group/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/routing/collection/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -165,37 +165,37 @@
<url>
<loc>/fluent/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/fluent/getting-started/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/fluent/model/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/fluent/database/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/fluent/query/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/fluent/relations/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -205,13 +205,13 @@
<url>
<loc>/cache/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/cache/overview/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -221,19 +221,19 @@
<url>
<loc>/mysql/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/mysql/provider/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/mysql/driver/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -243,13 +243,13 @@
<url>
<loc>/redis/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/redis/provider/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -259,37 +259,37 @@
<url>
<loc>/auth/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/auth/provider/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/auth/getting-started/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/auth/helper/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/auth/password/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/auth/persist/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -299,13 +299,13 @@
<url>
<loc>/sessions/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/sessions/sessions/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -315,61 +315,61 @@
<url>
<loc>/http/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/http/request/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/http/response/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/http/middleware/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/http/body/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/http/response-representable/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/http/responder/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/http/client/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/http/server/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/http/cors/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -379,19 +379,19 @@
<url>
<loc>/leaf/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/leaf/provider/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/leaf/leaf/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -400,7 +400,7 @@
<url>
<loc>/validation/overview/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -409,13 +409,13 @@
<url>
<loc>/node/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/node/getting-started/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -425,13 +425,13 @@
<url>
<loc>/core/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/core/overview/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -441,13 +441,13 @@
<url>
<loc>/bits/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/bits/overview/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -457,13 +457,13 @@
<url>
<loc>/debugging/package/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/debugging/overview/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -473,13 +473,13 @@
<url>
<loc>/deploy/nginx/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/deploy/supervisor/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
@ -489,19 +489,19 @@
<url>
<loc>/version/1_5/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/version/2_0/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/version/support/</loc>
<lastmod>2017-05-19</lastmod>
<lastmod>2017-05-22</lastmod>
<changefreq>daily</changefreq>
</url>

View File

@ -1984,7 +1984,7 @@
<h2 id="bcrypthasher">BCryptHasher<a class="headerlink" href="#bcrypthasher" title="Permanent link">&para;</a></h2>
<p>BCrypt is a password hashing function that automatically incorporates salts and offers a configurable work factor. The work factor can be used to increase the computation required to generate a hash.</p>
<p>BCrypt is a password hashing function that automatically incorporates salts and offers a configurable cost. The cost can be used to increase the computation required to generate a hash.</p>
<div class="admonition seealso">
<p class="admonition-title">Seealso</p>
<p>Learn more about <a href="https://en.wikipedia.org/wiki/Key_stretching">key stretching</a> on Wikipedia.</p>
@ -2000,21 +2000,21 @@
</pre></div>
<p>To configure the work factor, add a <code>bcrypt.json</code> file.</p>
<p>To configure the cost, add a <code>bcrypt.json</code> file.</p>
<p><code>Config/bcrypt.json</code></p>
<div class="codehilite"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;workFactor&quot;</span><span class="p">:</span> <span class="mi">8</span>
<span class="nt">&quot;cost&quot;</span><span class="p">:</span> <span class="mi">8</span>
<span class="p">}</span>
</pre></div>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>You can use different BCrypt work factors for production and development modes to keep password hashing fast while working on a project.</p>
<p>You can use different BCrypt costs for production and development modes to keep password hashing fast while working on a project.</p>
</div>
<h3 id="manual_1">Manual<a class="headerlink" href="#manual_1" title="Permanent link">&para;</a></h3>
<p>You can manually assign a <code>BCryptHasher</code> to <code>drop.hash</code>.</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span> <span class="nv">hash</span> <span class="p">=</span> <span class="n">BCryptHasher</span><span class="p">(</span><span class="n">workFactor</span><span class="p">:</span> <span class="mi">8</span><span class="p">)</span>
<div class="codehilite"><pre><span></span><span class="kd">let</span> <span class="nv">hash</span> <span class="p">=</span> <span class="n">BCryptHasher</span><span class="p">(</span><span class="n">cost</span><span class="p">:</span> <span class="mi">8</span><span class="p">)</span>
<span class="kd">let</span> <span class="nv">drop</span> <span class="p">=</span> <span class="k">try</span> <span class="n">Droplet</span><span class="p">(</span><span class="n">hash</span><span class="p">:</span> <span class="n">hash</span><span class="p">)</span>
</pre></div>