Skip to content

Commit

Permalink
Improve compatibility with additional runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
zigazajc007 committed Sep 19, 2024
1 parent 2d35e44 commit 0730b01
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rabbit-company/xchacha20",
"version": "2.2.1",
"version": "2.3.0",
"exports": "./src/xchacha20.ts",
"publish": {
"include": ["LICENSE", "README.md", "src/xchacha20.ts"]
Expand Down
2 changes: 1 addition & 1 deletion module/xchacha20.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class XChaCha20 {
}
static randomNonce() {
let rand_n = new Uint8Array(24);
crypto.getRandomValues(rand_n);
globalThis.crypto.getRandomValues(rand_n);
return rand_n;
}
static encrypt(message, secretKey) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rabbit-company/xchacha20",
"version": "2.2.1",
"version": "2.3.0",
"description": "XChaCha20 encryption",
"main": "./module/xchacha20.js",
"browser": "./module/xchacha20.js",
Expand Down Expand Up @@ -36,11 +36,11 @@
"security"
],
"devDependencies": {
"@types/bun": "^1.1.7",
"@types/bun": "^1.1.9",
"bun-plugin-dts": "^0.2.3",
"@rabbit-company/logger": "^4.0.0"
},
"peerDependencies": {
"typescript": "^5.5.4"
"typescript": "^5.6.2"
}
}
2 changes: 1 addition & 1 deletion src/xchacha20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export default class XChaCha20 {
*/
private static randomNonce(): Uint8Array {
let rand_n = new Uint8Array(24);
crypto.getRandomValues(rand_n);
globalThis.crypto.getRandomValues(rand_n);
return rand_n;
}

Expand Down

0 comments on commit 0730b01

Please sign in to comment.