Skip to content

Hash and Hmac should return Buffer not TypedArray #1313

Closed

Description

@Sytten

Node specifies that Hash and Hmac digest function should return a Buffer.
Right now they return a TypedArray which is wrong.
We should fix that with the refactor in #1292

Activity

  1. Aditya7880900936 commented on Jan 2, 2026

    @Aditya7880900936

    This makes sense — returning a TypedArray here seems inconsistent with the Node API expectations, especially given that Buffer is the documented return type.

    Since this looks related to the refactor in #1292, I can take a look at updating hash and hmac to return Buffer instead of TypedArray, and make sure any downstream usages/tests are adjusted accordingly.

    If that sounds good, I’m happy to put together a PR.

  2. Sytten commented on Jan 2, 2026

    @Sytten
    CollaboratorAuthor

    Its a two line change, we need to wait for the modular crypto to land. It was mostly a reminder for ourselves, all good.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions