Skip to content

Examples in readme don't work #20

@jtippett

Description

@jtippett

Trying to run the example in the readme:

box = Sodium::SecretBox.new

message = "foobar"
encrypted, nonce = box.encrypt message

# On the other side.
box = Sodium::SecretKey.new key
message = box.decrypt encrypted, nonce: nonce

Gets me this:

In enc.cr:23:7

 23 | box = Sodium::SecretKey.new key
            ^----------------
Error: undefined constant Sodium::SecretKey

I see various other implementations scattered through specs, examples and elsewhere. Is there a definitive version people should be following?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions