Skip to content

Use OpenSSL lib to generate salt#2

Open
newmanw wants to merge 1 commit into
btuttle:masterfrom
newmanw:master
Open

Use OpenSSL lib to generate salt#2
newmanw wants to merge 1 commit into
btuttle:masterfrom
newmanw:master

Conversation

@newmanw

@newmanw newmanw commented Mar 12, 2015

Copy link
Copy Markdown
Collaborator

OpenSSL::Random.random_bytes should give the correct number of bytes for salt.

irb(main):013:0> salt = OpenSSL::Random.random_bytes(6)
=> "S\xAFJ&\x15\x8D"

irb(main):014:0> salt.bytes.to_s
=> "[83, 175, 74, 38, 21, 141]"

fixes #1

OpenSSL::Random.random_bytes should give the correct number of bytes for salt.

```bash
irb(main):013:0> salt = OpenSSL::Random.random_bytes(6)
=> "S\xAFJ&\x15\x8D"
```
irb(main):014:0> salt.bytes.to_s
=> "[83, 175, 74, 38, 21, 141]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SecureRandom.base64 accepts character length of produced hash.

1 participant