-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* support v18 * add license * test node v18 in ci * changeset * test node v22 in ci * test latest node version in ci
- Loading branch information
1 parent
a77a256
commit e06bd48
Showing
5 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'livekit-server-sdk': patch | ||
--- | ||
|
||
support for node v18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,6 @@ | |
"vitest": "^2.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=19" | ||
"node": ">=18" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Use the Web Crypto API if available, otherwise fallback to Node.js crypto | ||
export default async function digest(data: string): Promise<ArrayBuffer> { | ||
if (globalThis.crypto?.subtle) { | ||
const encoder = new TextEncoder(); | ||
return crypto.subtle.digest('SHA-256', encoder.encode(data)); | ||
} else { | ||
const nodeCrypto = await import('node:crypto'); | ||
return nodeCrypto.createHash('sha256').update(data).digest(); | ||
} | ||
} |