Giter VIP home page Giter VIP logo

js-sha3's Introduction

js-sha3

Build Status Coverage Status
NPM

A simple SHA-3 / Keccak / Shake hash function for JavaScript supports UTF-8 encoding.

Notice

  • v0.8.0+ will throw an error if try to update hash after finalize.
  • Sha3 methods has been renamed to keccak since v0.2.0. It means that sha3 methods of v0.1.x are equal to keccak methods of v0.2.x and later.
  • buffer method is deprecated. This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.

Demo

SHA3-512 Online
SHA3-384 Online
SHA3-256 Online
SHA3-224 Online
Keccak-512 Online
Keccak-384 Online
Keccak-256 Online
Keccak-224 Online
Shake128 Online
Shake256 Online

Download

Compress
Uncompress

Installation

You can also install js-sha3 by using Bower.

bower install js-sha3

For node.js, you can use this command to install:

npm install js-sha3

Usage

You could use like this:

sha3_512('Message to hash');
sha3_384('Message to hash');
sha3_256('Message to hash');
sha3_224('Message to hash');
keccak512('Message to hash');
keccak384('Message to hash');
keccak256('Message to hash');
keccak224('Message to hash');
shake128('Message to hash', 256);
shake256('Message to hash', 512);
cshake128('Message to hash', 256, 'function name', 'customization');
cshake256('Message to hash', 512, 'function name', 'customization');
kmac128('key', 'Message to hash', 256, 'customization');
kmac256('key', 'Message to hash', 512, 'customization');

// Support ArrayBuffer output
var arrayBuffer = keccak224.arrayBuffer('Message to hash');

// Support Array output
var bytes = keccak224.digest('Message to hash');
var bytes = keccak224.array('Message to hash');

// update hash
sha3_512.update('Message ').update('to ').update('hash').hex();
// specify shake output bits at first update
shake128.update('Message ', 256).update('to ').update('hash').hex();

// or to use create
var hash = sha3_512.create();
hash.update('...');
hash.update('...');
hash.hex();

// specify shake output bits when creating
var hash = shake128.create(256);
hash.update('...');
hash.update('...');
hash.hex();

// specify cshake output bits, function name and customization when creating
var hash = cshake128.create(256, 'function name', 'customization');

// specify kmac key, output bits and customization when creating
var hash = kmac128.create('key', 256, 'customization');

Node.js

If you use node.js, you should require the module first:

const {
  sha3_512,
  sha3_384,
  sha3_256,
  sha3_224,
  keccak512,
  keccak384,
  keccak256,
  keccak224,
  shake128,
  shake256,
  cshake128,
  cshake256,
  kmac128,
  kmac25
} = require('js-sha3');

TypeScript

If you use TypeScript, you can import like this:

import {
  sha3_512,
  sha3_384,
  sha3_256,
  sha3_224,
  keccak512,
  keccak384,
  keccak256,
  keccak224,
  shake128,
  shake256,
  cshake128,
  cshake256,
  kmac128,
  kmac256
} from 'js-sha3';

Example

Code

sha3_512('');
// a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26

sha3_512('The quick brown fox jumps over the lazy dog');
// 01dedd5de4ef14642445ba5f5b97c15e47b9ad931326e4b0727cd94cefc44fff23f07bf543139939b49128caf436dc1bdee54fcb24023a08d9403f9b4bf0d450

sha3_512('The quick brown fox jumps over the lazy dog.');
// 18f4f4bd419603f95538837003d9d254c26c23765565162247483f65c50303597bc9ce4d289f21d1c2f1f458828e33dc442100331b35e7eb031b5d38ba6460f8

sha3_384('');
// 0c63a75b845e4f7d01107d852e4c2485c51a50aaaa94fc61995e71bbee983a2ac3713831264adb47fb6bd1e058d5f004

sha3_384('The quick brown fox jumps over the lazy dog');
// 7063465e08a93bce31cd89d2e3ca8f602498696e253592ed26f07bf7e703cf328581e1471a7ba7ab119b1a9ebdf8be41

sha3_384('The quick brown fox jumps over the lazy dog.');
// 1a34d81695b622df178bc74df7124fe12fac0f64ba5250b78b99c1273d4b080168e10652894ecad5f1f4d5b965437fb9

sha3_256('');
// a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a

sha3_256('The quick brown fox jumps over the lazy dog');
// 69070dda01975c8c120c3aada1b282394e7f032fa9cf32f4cb2259a0897dfc04

sha3_256('The quick brown fox jumps over the lazy dog.');
// a80f839cd4f83f6c3dafc87feae470045e4eb0d366397d5c6ce34ba1739f734d

sha3_224('');
// 6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7

sha3_224('The quick brown fox jumps over the lazy dog');
// d15dadceaa4d5d7bb3b48f446421d542e08ad8887305e28d58335795

sha3_224('The quick brown fox jumps over the lazy dog.');
// 2d0708903833afabdd232a20201176e8b58c5be8a6fe74265ac54db0

keccak512('');
// 0eab42de4c3ceb9235fc91acffe746b29c29a8c366b7c60e4e67c466f36a4304c00fa9caf9d87976ba469bcbe06713b435f091ef2769fb160cdab33d3670680e

keccak512('The quick brown fox jumps over the lazy dog');
// d135bb84d0439dbac432247ee573a23ea7d3c9deb2a968eb31d47c4fb45f1ef4422d6c531b5b9bd6f449ebcc449ea94d0a8f05f62130fda612da53c79659f609

keccak512('The quick brown fox jumps over the lazy dog.');
// ab7192d2b11f51c7dd744e7b3441febf397ca07bf812cceae122ca4ded6387889064f8db9230f173f6d1ab6e24b6e50f065b039f799f5592360a6558eb52d760

keccak384('');
// 2c23146a63a29acf99e73b88f8c24eaa7dc60aa771780ccc006afbfa8fe2479b2dd2b21362337441ac12b515911957ff

keccak384('The quick brown fox jumps over the lazy dog');
// 283990fa9d5fb731d786c5bbee94ea4db4910f18c62c03d173fc0a5e494422e8a0b3da7574dae7fa0baf005e504063b3

keccak384('The quick brown fox jumps over the lazy dog.');
// 9ad8e17325408eddb6edee6147f13856ad819bb7532668b605a24a2d958f88bd5c169e56dc4b2f89ffd325f6006d820b

keccak256('');
// c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470

keccak256('The quick brown fox jumps over the lazy dog');
// 4d741b6f1eb29cb2a9b9911c82f56fa8d73b04959d3d9d222895df6c0b28aa15

keccak256('The quick brown fox jumps over the lazy dog.');
// 578951e24efd62a3d63a86f7cd19aaa53c898fe287d2552133220370240b572d

keccak224('');
// f71837502ba8e10837bdd8d365adb85591895602fc552b48b7390abd

keccak224('The quick brown fox jumps over the lazy dog');
// 310aee6b30c47350576ac2873fa89fd190cdc488442f3ef654cf23fe

keccak224('The quick brown fox jumps over the lazy dog.');
// c59d4eaeac728671c635ff645014e2afa935bebffdb5fbd207ffdeab

shake128('', 256);
// 7f9c2ba4e88f827d616045507605853ed73b8093f6efbc88eb1a6eacfa66ef26

shake256('', 512);
// 46b9dd2b0ba88d13233b3feb743eeb243fcd52ea62b81b82b50c27646ed5762fd75dc4ddd8c0f200cb05019d67b592f6fc821c49479ab48640292eacb3b7c4be

It also supports UTF-8 encoding:

Code

sha3_512('中文');
// 059bbe2efc50cc30e4d8ec5a96be697e2108fcbf9193e1296192eddabc13b143c0120d059399a13d0d42651efe23a6c1ce2d1efb576c5b207fa2516050505af7

sha3_384('中文');
// 9fb5b99e3c546f2738dcd50a14e9aef9c313800c1bf8cf76bc9b2c3a23307841364c5a2d0794702662c5796fb72f5432

sha3_256('中文');
// ac5305da3d18be1aed44aa7c70ea548da243a59a5fd546f489348fd5718fb1a0

sha3_224('中文');
// 106d169e10b61c2a2a05554d3e631ec94467f8316640f29545d163ee

keccak512('中文');
// 2f6a1bd50562230229af34b0ccf46b8754b89d23ae2c5bf7840b4acfcef86f87395edc0a00b2bfef53bafebe3b79de2e3e01cbd8169ddbb08bde888dcc893524

keccak384('中文');
// 743f64bb7544c6ed923be4741b738dde18b7cee384a3a09c4e01acaaac9f19222cdee137702bd3aa05dc198373d87d6c

keccak256('中文');
// 70a2b6579047f0a977fcb5e9120a4e07067bea9abb6916fbc2d13ffb9a4e4eee

keccak224('中文');
// f71837502ba8e10837bdd8d365adb85591895602fc552b48b7390abd

It also supports byte Array, Uint8Array, ArrayBuffer input:

Code

sha3_512([]);
// a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26

sha3_512(new Uint8Array([]));
// a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26

// ...

Benchmark

UTF8
ASCII

License

The project is released under the MIT license.

Contact

The project's website is located at https://github.com/emn178/js-sha3
Author: Chen, Yi-Cyuan ([email protected])

js-sha3's People

Contributors

adon-at-work avatar dependabot[bot] avatar emn178 avatar iatll avatar isaactorresmichel avatar legobeat avatar micahzoltu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js-sha3's Issues

Suppressing invalid usage is bad design

so take the following misconception: looking at the docs you could easily draw the wrong conclusion that you can instantiate an algorithm and then simply update and reuse it. Being "smart" devs this looks like a good idea as it presumably increases performance.

But that isn't true, here's what happens:

import { shake128 } from 'js-sha3';

const shake = shake128.create(64); // trying to be smart cookie

shake.update('t1');
console.info(shake.hex()); // prints a82b7e93c21689d6
shake.update('t2'); // this should error as it's finalized already
console.info(shake.hex());  // prints a82b7e93c21689d6

In this case, calling update on a finalized hasher is invalid, but since it doesn't error you aren't aware that your usage is invalid, which can lead to some nasty bugs in userland.

unhandled promise rejection

I have a Gatsby app that is throwing the error below when building it for development ( did not test for production )

So in terminal I run: gatsby develop

Then the error below is thrown after queries are executed. It will output 3 times what appears to be the same error:

success onPostBootstrap - 0.123s

info bootstrap finished - 155.297 s

success run queries - 206.420s - 1018/1018 4.93/s
[======= ] 206.423 s 1/4 25% Generating image thumbnails
(node:2655) UnhandledPromiseRejectionWarning: Error: input is invalid type
at Keccak../node_modules/js-sha3/src/sha3.js.Keccak.update (/Users/bernardo/Sites/quiamo/public/render-page.js:243196:15)
at /Users/bernardo/Sites/quiamo/public/render-page.js:243055:46
at getPaths (/Users/bernardo/Sites/quiamo/public/render-page.js:201337:29)
at Object.create (/Users/bernardo/Sites/quiamo/public/render-page.js:201645:19)
at _prepareChannel (/Users/bernardo/Sites/quiamo/public/render-page.js:199839:37)
at new BroadcastChannel (/Users/bernardo/Sites/quiamo/public/render-page.js:199719:3)
at createStateSyncMiddleware (/Users/bernardo/Sites/quiamo/public/render-page.js:311129:19)
at Module../src/store/reduxWrapper.js (/Users/bernardo/Sites/quiamo/public/render-page.js:319235:104)
at webpack_require (/Users/bernardo/Sites/quiamo/public/render-page.js:30:30)
at Module../gatsby-ssr.js (/Users/bernardo/Sites/quiamo/public/render-page.js:1692:81)
at webpack_require (/Users/bernardo/Sites/quiamo/public/render-page.js:30:30)
at Object../.cache/api-runner-ssr.js (/Users/bernardo/Sites/quiamo/public/render-page.js:134:11)
at webpack_require (/Users/bernardo/Sites/quiamo/public/render-page.js:30:30)
at Module../.cache/develop-static-entry.js (/Users/bernardo/Sites/quiamo/public/render-page.js:467:73)
at webpack_require (/Users/bernardo/Sites/quiamo/public/render-page.js:30:30)
at /Users/bernardo/Sites/quiamo/public/render-page.js:94:18
(node:2655) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:2655) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Environment:
node v12.16.0

ESM support?

Is it planned?
If not, would you be open to accept a pull request that would refactor it to ESM?

{ "manifest_version": 2, "name": "__MSG_extName__", "description": "__MSG_extDescription__", "version": "0.0.7", "permissions": [ "activeTab", "cookies", "notifications", "tabs", "https://localhost:25519/*", "https://*.mail.yahoo.com/*", "https://www.facebook.com/*/publickey/download?_rdr=p" ], "optional_permissions": [], "background": {"scripts": ["launcher_binary.js"]}, "options_page": "settings.html", "browser_action": { "default_title": "__MSG_extName__", "default_icon": "images/yahoo/icon-128.png", "default_popup": "prompt.html" }, "content_scripts": [ { "matches": ["https://*.mail.yahoo.com/*"], "js": ["helper_binary.js"] } ], "icons": { "16": "images/yahoo/icon-16.png", "48": "images/yahoo/icon-48.png", "128": "images/yahoo/icon-128.png" }, "web_accessible_resources": ["glass.html", "gmonkeystub.js", "composeglass.html"], "default_locale": "en" }

How to generate the sha3-256 hash?

I want use it to generate sha3-256 hash, what should i do?below is realization of the package futoin-hkdf

const hkdf = new Hkdf.Hkdf('sha3-256');
const masterPrk =hkdf.extract('aaa', 'bbb');
const secretKey =hkdf.expand(masterPrk, 'ccc', 32);

SHA3 for Binary File

Hi,

I am using FileReader.readAsArrayBuffer to read contents of a binary file. How should I convert the arraybuffer to the format (UTF8 or ASCII?) that will work with js-sha3?

Thanks

Ken

Suggestion: SHAKE128 and SHAKE256

Will you consider supporting those XOF functions including SHAKE128 and SHAKE256?

As I observed, the quick hack is to use a special padding: [0x1F, 0x1F00, 0x1F0000, 0x1F000000], and the first b * 2 bits out of the states seems to be good enough. Making it fully compatible with the standard is a little bit harder though.

Thoughts? :)

Reference: http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf See Section 6.2 in p.20

I'd like to also thank for publishing your library. 👍

Sveltekit + Vite unable to import function

Environment

Sveltekit + Vite + NPM

Attempt 1

I tried to import with

import { sha3_512 } from "js-sha3";

but npm run build gives me an error message:

import { sha3_512 } from "js-sha3";
         ^^^^^^^^
SyntaxError: Named export 'sha3_512' not found. The requested module 'js-sha3' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'js-sha3';
const { sha3_512 } = pkg;

Attempt 2

However, when I switch to

import pkg from 'js-sha3';
const { sha3_512 } = pkg;

I found this runtime error:

...
Runtime.UnhandledPromiseRejection","errorMessage":"TypeError: sha3_512 is not a function","reason":{"errorType":"TypeError","errorMessage":"sha3_512 is not a function","stack":["TypeError: sha3_512 is not a function","
...

My Guess

I doubt the sha3_512 function is tree-shaked by vite compiler, but I'm not sure why.

Possible fix

  1. Try to make the package a non-CommonJS module by setting "type": "module" in package.json?
  2. Make sure to export the sha3_512 function in a way that vite build won't tree-shake the function?

Not SHA-3

Please be aware that your algorithm is the old suggestion of NIST.
The update in 4/2014 adds padding (01), so what you are testing and implementing is basically Keccak - but not SHA-3 anymore!
See the new NIST test vectors, please.

cSHAKE implementation produces invalid output

You have issue with cshake implementation here:

var paddingBytes = w - bytes % w;

it should be var paddingBytes = (w - bytes % w) % w;, since it should not pad if value is already divisible by block size without remainder.
(spec: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf: bytepad function step 3 here: while (len(z)/8) mod w ≠ 0:
We encountered the same error in noble-hashes, which contains XKCP-generated test vectors

Test case which triggers the error:

let str='084fed08b978af4d7d196a7446a86b58009e636b611db16211b65a9aadff29c5084fed08b978af4d7d196a7446a86b58009e636b611db16211b65a9aadff29c5084fed08b978af4d7d196a7446a86b58009e636b611db16211b65a9aadff29c5084fed08b978af4d7d196a7446a86b58009e636b611db16211b65a9aad';
Buffer.from(new Uint8Array(require('js-sha3').kmac256.create(Buffer.from([]), 16*8, Buffer.from(str, 'hex')).update(Buffer([])).arrayBuffer())).toString('hex')==='031801b0b50ebeef772fbe7a279bc144'

Instead, it returns bc58e9c8534e5fa7346f06e6ab25e2db

Suggestion: ArrayBuffer() as output

I'd like to use it with ArrayBuffer() instead of a hex string as output. I can then further manipulate the bytes. I have made a local copy to get this done, and would like to see if you want me to contribute a PR for that.

npm install [email protected] doesn't work in Browser

The NPM package js-sha3 at 0.5.3 version doesn't work in Browser (client-side). For importing the node package to client side, i'm using meteor-node-stubs package (https://github.com/meteor/node-stubs), it's a Browserify implementation for Meteor.

When requiring/importing the sha3_512 method, i only receive an empty object.

Server side works as intended.

The last version, 0.5.2, works like a charm when called in the Browser via meteor-node-stubs. So my actual fix is use that previous version. Can you point me why doesn't import to client now? Could be incompatibilities with meteor-node-stubs?

Thanks

ViteX Exchange Wallet depends on this and fails to build.

error V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3
Output:
V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3>if not defined npm_config_node_gyp (node "G:\Tools\NodeJS\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.12.2 found at "C:\Python312\python.exe"

gyp info find VS using VS2022 (17.8.34316.72) found at:
gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Python312\python.exe
gyp info spawn args [
gyp info spawn args 'G:\Tools\NodeJS\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-I',
gyp info spawn args 'V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'G:\Tools\NodeJS\node_modules\npm\node_modules\node-gyp\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\skybu\AppData\Local\node-gyp\Cache\20.12.2\include\node\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\Users\skybu\AppData\Local\node-gyp\Cache\20.12.2',
gyp info spawn args '-Dnode_gyp_dir=G:\Tools\NodeJS\node_modules\npm\node_modules\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\Users\\skybu\\AppData\\Local\\node-gyp\\Cache\\20.12.2\\<(target_arch)\\node.lib',
gyp info spawn args '-Dmodule_root_dir=V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args 'build\binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]

addon.cpp
V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan_callbacks.h(55,23): error C2039: 'AccessorSignature': is not a member of 'v8' [V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\sha3.vcxproj]
(compiling source file '../src/addon.cpp')
C:\Users\skybu\AppData\Local\node-gyp\Cache\20.12.2\include\node\v8.h(71,11):
see declaration of 'v8'

V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan_callbacks.h(55,23): error C2065: 'AccessorSignature': undeclared identifier [V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\sha3.vcxproj]
(compiling source file '../src/addon.cpp')

V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan_callbacks.h(55,13): error C2923: 'v8::Local': 'AccessorSignature' is not a valid template type argument for parameter 'T' [V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\sha3.vcxproj]
(compiling source file '../src/addon.cpp')
V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan_callbacks.h(55,23):
see declaration of 'AccessorSignature'

V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan_callbacks.h(55,42): error C2955: 'v8::Local': use of class template requires template argument list [V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\sha3.vcxproj]
(compiling source file '../src/addon.cpp')
C:\Users\skybu\AppData\Local\node-gyp\Cache\20.12.2\include\node\v8-local-handle.h(190,13):
see declaration of 'v8::Local'

V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2444,14): error C2955: 'v8::Local': use of class template requires template argument list [V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\sha3.vcxproj]
(compiling source file '../src/addon.cpp')
C:\Users\skybu\AppData\Local\node-gyp\Cache\20.12.2\include\node\v8-local-handle.h(190,13):
see declaration of 'v8::Local'

V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2444,34): error C2641: cannot deduce template arguments for 'v8::Local' [V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\sha3.vcxproj]
(compiling source file '../src/addon.cpp')

V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2444,34): error C2780: 'v8::Local v8::Local(T *)': expects 1 arguments - 0 provided [V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\sha3.vcxproj]
(compiling source file '../src/addon.cpp')
C:\Users\skybu\AppData\Local\node-gyp\Cache\20.12.2\include\node\v8-local-handle.h(331,3):
see declaration of 'v8::Local'

V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2444,34): error C2780: 'v8::Local v8::Local(v8::Local)': expects 1 arguments - 0 provided [V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\sha3.vcxproj]
(compiling source file '../src/addon.cpp')
C:\Users\skybu\AppData\Local\node-gyp\Cache\20.12.2\include\node\v8-local-handle.h(195,3):
see declaration of 'v8::Local'

V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2444,34): error C2783: 'v8::Local v8::Local(void)': could not deduce template argument for 'T' [V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\sha3.vcxproj]
(compiling source file '../src/addon.cpp')
C:\Users\skybu\AppData\Local\node-gyp\Cache\20.12.2\include\node\v8-local-handle.h(192,3):
see declaration of 'v8::Local'

V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2444,34): error C2780: 'v8::Local v8::Local(v8::Local)': expects 1 arguments - 0 provided [V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\sha3.vcxproj]
(compiling source file '../src/addon.cpp')
C:\Users\skybu\AppData\Local\node-gyp\Cache\20.12.2\include\node\v8-local-handle.h(190,13):
see declaration of 'v8::Local'

V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2470,6): error C2665: 'v8::ObjectTemplate::SetAccessor': no overloaded function could convert all the argument types [V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\build\sha3.vcxproj]
(compiling source file '../src/addon.cpp')
C:\Users\skybu\AppData\Local\node-gyp\Cache\20.12.2\include\node\v8-template.h(816,8):
could be 'void v8::ObjectTemplate::SetAccessor(v8::Localv8::Name,v8::AccessorNameGetterCallback,v8::AccessorNameSetterCallback,v8::Localv8::Value,v8::AccessControl,v8::PropertyAttribute,v8::SideEffectType,v8::SideEffectType)'
V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2470,6):
'void v8::ObjectTemplate::SetAccessor(v8::Localv8::Name,v8::AccessorNameGetterCallback,v8::AccessorNameSetterCallback,v8::Localv8::Value,v8::AccessControl,v8::PropertyAttribute,v8::SideEffectType,v8::SideEffectType)': cannot convert argument 7 from 'Nan::imp::Sig' to 'v8::SideEffectType'
V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2477,7):
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Users\skybu\AppData\Local\node-gyp\Cache\20.12.2\include\node\v8-template.h(809,8):
or 'void v8::ObjectTemplate::SetAccessor(v8::Localv8::String,v8::AccessorGetterCallback,v8::AccessorSetterCallback,v8::Localv8::Value,v8::AccessControl,v8::PropertyAttribute,v8::SideEffectType,v8::SideEffectType)'
V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2470,6):
'void v8::ObjectTemplate::SetAccessor(v8::Localv8::String,v8::AccessorGetterCallback,v8::AccessorSetterCallback,v8::Localv8::Value,v8::AccessControl,v8::PropertyAttribute,v8::SideEffectType,v8::SideEffectType)': cannot convert argument 2 from 'Nan::imp::NativeGetter' to 'v8::AccessorGetterCallback'
V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2472,7):
This conversion requires a reinterpret_cast, a C-style cast or parenthesized function-style cast
V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3\node_modules\nan\nan.h(2470,6):
while trying to match the argument list '(v8::Localv8::String, Nan::imp::NativeGetter, Nan::imp::NativeSetter, v8::Localv8::Object, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)'

gyp ERR! build error
gyp ERR! stack Error: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess. (G:\Tools\NodeJS\node_modules\npm\node_modules\node-gyp\lib\build.js:209:23)
gyp ERR! stack at ChildProcess.emit (node:events:518:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Windows_NT 10.0.22631
gyp ERR! command "G:\Tools\NodeJS\node.exe" "G:\Tools\NodeJS\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd V:\Worktrees\ViteXWallet\version-1.6.9\vite-web-wallet\node_modules\sha3

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.