Giter Club home page Giter Club logo

Comments (6)

382303784 avatar 382303784 commented on August 29, 2024

I have encountered some problems while using it.

//first
npm install argon2-browser

//code
const argon2 = require("argon2-browser");
const _hash = await argon2.hash({
        pass:'password',
        salt: "salt"
    });

//result
ReferenceError: TextEncoder is not defined
ReferenceError: TextEncoder is not defined

E:\work\czr-remix-ide\czr\czr_account.js\node_modules\argon2-browser\dist\argon2.js:1
(function (exports, require, module, __filename, __dirname) { var Module=typeof self!=="undefined"&&typeof self.Module!=="undefined"?self.Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONME
abort(ReferenceError: TextEncoder is not defined). Build with -s ASSERTIONS=1 for more info.

Code is part of the code

from argon2-browser.

ms140569 avatar ms140569 commented on August 29, 2024

I do have this problem with the examples as well:

examples/node/argon2-demo-node.js

from argon2-browser.

afrancht avatar afrancht commented on August 29, 2024

Are you using React?

from argon2-browser.

ms140569 avatar ms140569 commented on August 29, 2024

No, not at all...

from argon2-browser.

382303784 avatar 382303784 commented on August 29, 2024

Are you using React?

no

from argon2-browser.

antelle avatar antelle commented on August 29, 2024

Hi! TextEncoder was added in node.js 11: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V11.md
Added support for old node.js as well.

from argon2-browser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.