Skip to content

Commit

Permalink
[skip ci] Re-order usage sections
Browse files Browse the repository at this point in the history
  • Loading branch information
mudge committed Nov 8, 2024
1 parent be84560 commit b690a51
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ password.salt #=> "e-\xA7\x04U\x81\xA6{v\xF0x\xED\xCC\xD3\x96\xE3"
* [Hashing passwords](#hashing-passwords)
* [Verifying passwords](#verifying-passwords)
* [Validating encoded hashes](#validating-encoded-hashes)
* [Usage with Active Record](#usage-with-active-record)
* [Errors](#errors)
* [Usage with Active Record](#usage-with-active-record)
* [Requirements](#requirements)
* [Native gems](#native-gems)
* [Verifying the gems](#verifying-the-gems)
Expand Down Expand Up @@ -188,6 +188,15 @@ Argon2id::Password.valid_hash?("$2a$12$stsRn7Mi9r02.keRyF4OK.Aq4UWOU185lWggfUQfc
#=> false
```
### Errors
Any errors returned from Argon2 will be raised as `Argon2id::Error`, e.g.
```ruby
Argon2id::Password.create("password", salt_len: 0)
# Salt is too short (Argon2id::Error)
```
### Usage with Active Record
If you're planning to use this with Active Record instead of [Rails' own
Expand Down Expand Up @@ -244,15 +253,6 @@ User.find_by(name: "alice")&.authenticate("notright") #=> false
User.find_by(name: "alice")&.authenticate("password") #=> user
```
### Errors

Any errors returned from Argon2 will be raised as `Argon2id::Error`, e.g.

```ruby
Argon2id::Password.create("password", salt_len: 0)
# Salt is too short (Argon2id::Error)
```

## Requirements

This gem requires any of the following to run:
Expand Down

0 comments on commit b690a51

Please sign in to comment.