Skip to content

Crypto docs don't explain the function signatures #12946

Description

@stuartpb

I just spent about an hour bashing my head against the wall because the documentation for crypto.publicEncrypt & co. don't explain that they return a new Buffer with the encrypted data instead of encrypting the passed-in Buffer in place.

Yes, in hindsight, this should have been obvious, but I don't get why these functions don't explain their return values when so much of the rest of core does.

Activity

  1. added
    docIssues and PRs related to Node.js documentation.
    cryptoIssues and PRs related to the crypto subsystem.
    good first issueIssues that are suitable for first-time contributors.
    on May 10, 2017
  2. Trott commented on May 10, 2017

    @Trott
    Member

    Thanks for reporting this. If you or someone else wants to update the documentation and submit a pull request, the markdown file containing the relevant documentation is doc/api/crypto.md.

  3. removed
    good first issueIssues that are suitable for first-time contributors.
    on May 10, 2017
  4. added a commit that references this issue on May 19, 2017
  5. stuartpb commented on May 19, 2017

    @stuartpb
    Author

    Okay, that fixes the documentation for publicEncrypt, but it doesn't touch the documentation for the other three functions like it (and I'd expect that there are more ambiguities like this in the docs right now).

    Also, isn't there a formal way of documenting a function's return type?

  6. addaleax commented on May 19, 2017

    @addaleax
    Member

    Ah, right. Sorry, reopening.

    Also, isn't there a formal way of documenting a function's return type?

    I think there is, we have something like * Returns: {integer} The number of bytes contained within `string` for that.

  7. added
    good first issueIssues that are suitable for first-time contributors.
    on May 20, 2017
  8. jieyanhuang commented on Oct 14, 2017

    @jieyanhuang
    Contributor

    Looks like the PR never got merged, does this still require attention? I can clean this up if help is still needed

  9. joyeecheung commented on Oct 15, 2017

    @joyeecheung
    Member

    @jieyanhuang Please do! Our contributing guide should provide enough guidance on how to sumbit a PR.

  10. jieyanhuang commented on Oct 16, 2017

    @jieyanhuang
    Contributor

    @joyeecheung I've made a PR to address this. Let me know if I missed anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cryptoIssues and PRs related to the crypto subsystem.docIssues and PRs related to Node.js documentation.good first issueIssues that are suitable for first-time contributors.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions