Closed caramboleyo closed 1 year ago
Version 1.0.1 is not supported. Use the latest version.
I am actually using the main branch from here and all i had to do is replace line 11 in index.ts with const nodeCrypto = null;
and then import from index.ts directly.
If you are using main branch from here, you should have looked in the readme to understand how to make it run with Deno, without adjusting the code.
@paulmillr this is an example how the deno guys make conditional imports: https://deno.land/std@0.160.0/path/mod.ts?source
(forget the import maps, they kinda break common deno usage)
EDIT: forget that, they also end up importing both posix and win32 on a linux system, so not conditional at all
we need to support all platforms, that includes node.js, node.js esm, webpack/rollup/browserify/react-native, deno, etc - so we got what we got here. Use import maps.
As described here https://deno.land/x/ed25519@1.0.1
i just do a
import * as ed from 'https://deno.land/x/ed25519/mod.ts';
resulting in this:Looks like you try to import npm packages in deno but in index.ts you seem to know that deno has built in webcrypto support since you are doing
crypto.subtle.digestSync('SHA-512'..
. Is this a bug?EDIT: Also this:
import { crypto } from 'https://deno.land/std@0.153.0/crypto/mod.ts';
is unnecessary, crypto.subtle works in deno out of the box, no import needed. But maybe thats a recent development.