Skip to content

Using as an ES module #82

Description

@paulhiggs

Do you have any suggestions or project updates on how to use this library as an ES module?

I try

import {sha1} from "sha.js"

var hash = sha1("sha1").update("Hello World!").digest("hex");

but always get a message like

TypeError: Cannot read properties of undefined (reading 'init')
    at Sha (D:\Documents\code\dvb-i-tools.maint\node_modules\sha.js\sha.js:22:7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions