Skip to content

Vapor 2.0 Alpha 1

Pre-release
Pre-release
Compare
Choose a tag to compare
@tanner0101 tanner0101 released this 10 Feb 11:17
· 2924 commits to main since this release

HashProtocol

HashProtocol has been simplified removing keyed hashing. This must now be taken care of at init time for hashers that support it.

A check function has been added to check if plaintext data matches a hash. For algorithms like BCrypt, this is required since hashes for the same message aren't required to be the same.

.string will be required after calling hash.make() since it now returns Bytes

BCrypt

A BCryptHasher has been added.

To use:

  • Set "bcrypt" to key droplet.hash in the config files ("crypto" by default).
  • Add a bcrypt.json file:
{
    "workFactor": x
}

ConfigError

A new ConfigError error has been created to help clean up a bunch of different types of errors that were being thrown when parsing Config f iles.