rustbn-wasm
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -8,2 +8,6 @@ # Changelog | ||
## 0.3.0 - 2024-02-14 | ||
- Improved (older version) ESM support (❤️ to @roninjin10 for the contribution), PR [#7](https://github.com/ethereumjs/rustbn-wasm/pull/7) | ||
## 0.2.0 - 2023-07-04 | ||
@@ -10,0 +14,0 @@ |
import { base64 } from '@scure/base'; | ||
import wasmB64 from './wasm.json' assert { "type": "JSON" }; | ||
import wasmB64 from './wasm.js'; | ||
const imports = {}; | ||
@@ -4,0 +4,0 @@ let wasm; |
{ | ||
"name": "rustbn-wasm", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Javascript bindings for https://github.com/paritytech/bn (using WASM)", | ||
@@ -25,2 +25,3 @@ "keywords": [ | ||
"build": "npm run build-node && npm run wasm2b64 && npm run build-esm", | ||
"test": "vitest run test/*", | ||
"wasm2b64": "node scripts/wasmToB64.js" | ||
@@ -31,3 +32,3 @@ }, | ||
"dependencies": { | ||
"@scure/base": "^1.1.1" | ||
"@scure/base": "^1.1.5" | ||
}, | ||
@@ -37,4 +38,5 @@ "devDependencies": { | ||
"copy-webpack-plugin": "^5.0.3", | ||
"typescript": "^5.1.5" | ||
"typescript": "^5.1.5", | ||
"vitest": "^1.2.2" | ||
} | ||
} |
import { base64 } from '@scure/base' | ||
import wasmB64 from './wasm.json' assert { "type": "JSON" } | ||
import wasmB64 from './wasm.js' | ||
const imports = {} | ||
@@ -22,13 +22,13 @@ | ||
typeof cachedTextEncoder.encodeInto === 'function' | ||
? function (arg: any, view: any) { | ||
return cachedTextEncoder.encodeInto(arg, view) | ||
? function(arg: any, view: any) { | ||
return cachedTextEncoder.encodeInto(arg, view) | ||
} | ||
: function(arg: any, view: any) { | ||
const buf = cachedTextEncoder.encode(arg) | ||
view.set(buf) | ||
return { | ||
read: arg.length, | ||
written: buf.length, | ||
} | ||
: function (arg: any, view: any) { | ||
const buf = cachedTextEncoder.encode(arg) | ||
view.set(buf) | ||
return { | ||
read: arg.length, | ||
written: buf.length, | ||
} | ||
} | ||
} | ||
@@ -95,3 +95,3 @@ function passStringToWasm0(arg: string, malloc: any, realloc: any) { | ||
*/ | ||
export const ec_mul = function (input_hex: string) { | ||
export const ec_mul = function(input_hex: string) { | ||
let deferred2_0 | ||
@@ -119,3 +119,3 @@ let deferred2_1 | ||
*/ | ||
export const ec_add = function (input_str: string) { | ||
export const ec_add = function(input_str: string) { | ||
let deferred2_0 | ||
@@ -143,3 +143,3 @@ let deferred2_1 | ||
*/ | ||
export const ec_pairing = function (input_str: string): string { | ||
export const ec_pairing = function(input_str: string): string { | ||
let deferred2_0 | ||
@@ -146,0 +146,0 @@ let deferred2_1 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
668727
22
4
1387
1
Updated@scure/base@^1.1.5