This commit is contained in:
Tanner Nelson 2017-03-03 19:45:41 +01:00
parent 30ab3183fa
commit aa23a15b22
No known key found for this signature in database
GPG Key ID: 9C24375C64856B76
1 changed files with 6 additions and 2 deletions

View File

@ -2,12 +2,16 @@
Hashing 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.
<img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/5/58/Hash_table_4_1_1_0_0_1_0_LL.svg/240px-Hash_table_4_1_1_0_0_1_0_LL.svg.png" width="240" height="184">
> Hash function diagram from [Wikipedia](https://en.wikipedia.org/wiki/Hash_function).
!!! warning
Avoid storing passwords if possible. If you must, please make sure to research the state of the art before continuing.
Avoid storing password hashes if possible. If you must, please make sure to research the state of the art before continuing.
## Make
To hash a string, use the `hash` class on `Droplet`.
To hash a string, use the `hash` property on `Droplet`.
```swift
let digest = try drop.hash.make("vapor")