@ngxsp/core 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +0 -59
- package/index.cjs.map +1 -1
- package/index.d.ts +0 -1
- package/index.js +1 -54
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/domain/vault.d.ts +0 -55
package/index.cjs
CHANGED
|
@@ -2809,59 +2809,6 @@ function createShakeDetector(options = {}) {
|
|
|
2809
2809
|
return { read, settle, pendingFor, reset };
|
|
2810
2810
|
}
|
|
2811
2811
|
|
|
2812
|
-
// src/domain/vault.ts
|
|
2813
|
-
var VAULT_ROUNDS = 31e4;
|
|
2814
|
-
async function hashPasscode(code, crypto, options = {}) {
|
|
2815
|
-
const rounds = options.rounds ?? VAULT_ROUNDS;
|
|
2816
|
-
const salt = options.salt ?? toBase64(crypto.getRandomValues(new Uint8Array(16)));
|
|
2817
|
-
const key = await crypto.subtle.importKey("raw", encode(code), "PBKDF2", false, ["deriveBits"]);
|
|
2818
|
-
const bits = await crypto.subtle.deriveBits(
|
|
2819
|
-
{ name: "PBKDF2", salt: fromBase64(salt), iterations: rounds, hash: "SHA-256" },
|
|
2820
|
-
key,
|
|
2821
|
-
256
|
|
2822
|
-
);
|
|
2823
|
-
return { salt, hash: toBase64(new Uint8Array(bits)), rounds };
|
|
2824
|
-
}
|
|
2825
|
-
async function verifyPasscode(code, record, crypto) {
|
|
2826
|
-
if (!record?.hash || !record.salt) return false;
|
|
2827
|
-
const candidate = await hashPasscode(code, crypto, { salt: record.salt, rounds: record.rounds });
|
|
2828
|
-
return equalInConstantTime(candidate.hash, record.hash);
|
|
2829
|
-
}
|
|
2830
|
-
function isUsablePasscode(code) {
|
|
2831
|
-
return /^[0-9]{4,}$/.test(code) && new Set(code).size > 1;
|
|
2832
|
-
}
|
|
2833
|
-
function hiddenIds(locked, state) {
|
|
2834
|
-
return state.open || !state.hasPasscode ? /* @__PURE__ */ new Set() : new Set(locked);
|
|
2835
|
-
}
|
|
2836
|
-
function withoutHidden(items, idOf, hidden) {
|
|
2837
|
-
return hidden.size ? items.filter((item) => !hidden.has(idOf(item))) : [...items];
|
|
2838
|
-
}
|
|
2839
|
-
function encode(text6) {
|
|
2840
|
-
const encoded = new TextEncoder().encode(text6);
|
|
2841
|
-
const bytes = new Uint8Array(new ArrayBuffer(encoded.length));
|
|
2842
|
-
bytes.set(encoded);
|
|
2843
|
-
return bytes.buffer;
|
|
2844
|
-
}
|
|
2845
|
-
function toBase64(bytes) {
|
|
2846
|
-
let binary = "";
|
|
2847
|
-
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
2848
|
-
return btoa(binary);
|
|
2849
|
-
}
|
|
2850
|
-
function fromBase64(text6) {
|
|
2851
|
-
const binary = atob(text6);
|
|
2852
|
-
const bytes = new Uint8Array(new ArrayBuffer(binary.length));
|
|
2853
|
-
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
2854
|
-
return bytes.buffer;
|
|
2855
|
-
}
|
|
2856
|
-
function equalInConstantTime(left, right) {
|
|
2857
|
-
if (left.length !== right.length) return false;
|
|
2858
|
-
let difference = 0;
|
|
2859
|
-
for (let index = 0; index < left.length; index += 1) {
|
|
2860
|
-
difference |= left.charCodeAt(index) ^ right.charCodeAt(index);
|
|
2861
|
-
}
|
|
2862
|
-
return difference === 0;
|
|
2863
|
-
}
|
|
2864
|
-
|
|
2865
2812
|
// src/domain/device-playback.ts
|
|
2866
2813
|
function createIdleDevicePlaybackState(message) {
|
|
2867
2814
|
return {
|
|
@@ -5446,7 +5393,6 @@ exports.SUBSONIC_API_VERSION = SUBSONIC_API_VERSION;
|
|
|
5446
5393
|
exports.SUBSONIC_CLIENT = SUBSONIC_CLIENT;
|
|
5447
5394
|
exports.SimpleEventBus = SimpleEventBus;
|
|
5448
5395
|
exports.UpnpActionError = UpnpActionError;
|
|
5449
|
-
exports.VAULT_ROUNDS = VAULT_ROUNDS;
|
|
5450
5396
|
exports.applyAudioIdentification = applyAudioIdentification;
|
|
5451
5397
|
exports.applyEngineProfileToSource = applyEngineProfileToSource;
|
|
5452
5398
|
exports.applyRemoteConfig = applyRemoteConfig;
|
|
@@ -5510,8 +5456,6 @@ exports.folderArtworkRank = folderArtworkRank;
|
|
|
5510
5456
|
exports.formatRemoteClock = formatRemoteClock;
|
|
5511
5457
|
exports.getEngineProfileHints = getEngineProfileHints;
|
|
5512
5458
|
exports.harmonizeAudioMetadata = harmonizeAudioMetadata;
|
|
5513
|
-
exports.hashPasscode = hashPasscode;
|
|
5514
|
-
exports.hiddenIds = hiddenIds;
|
|
5515
5459
|
exports.internetArchiveAudioTracks = internetArchiveAudioTracks;
|
|
5516
5460
|
exports.internetArchiveDetailsUrl = internetArchiveDetailsUrl;
|
|
5517
5461
|
exports.internetArchiveDownloadUrl = internetArchiveDownloadUrl;
|
|
@@ -5520,7 +5464,6 @@ exports.isCategorizedEventType = isCategorizedEventType;
|
|
|
5520
5464
|
exports.isIgnoredDirectoryName = isIgnoredDirectoryName;
|
|
5521
5465
|
exports.isImageFileName = isImageFileName;
|
|
5522
5466
|
exports.isMediaFileName = isMediaFileName;
|
|
5523
|
-
exports.isUsablePasscode = isUsablePasscode;
|
|
5524
5467
|
exports.jellyfinClientHeader = jellyfinClientHeader;
|
|
5525
5468
|
exports.jellyfinImageUrl = jellyfinImageUrl;
|
|
5526
5469
|
exports.jellyfinStreamUrl = jellyfinStreamUrl;
|
|
@@ -5580,9 +5523,7 @@ exports.subsonicStreamUrl = subsonicStreamUrl;
|
|
|
5580
5523
|
exports.subtitleTextToVtt = subtitleTextToVtt;
|
|
5581
5524
|
exports.ticksToSeconds = ticksToSeconds;
|
|
5582
5525
|
exports.upnpAction = upnpAction;
|
|
5583
|
-
exports.verifyPasscode = verifyPasscode;
|
|
5584
5526
|
exports.videoFieldsFromTags = videoFieldsFromTags;
|
|
5585
5527
|
exports.webDavAuthorization = webDavAuthorization;
|
|
5586
|
-
exports.withoutHidden = withoutHidden;
|
|
5587
5528
|
//# sourceMappingURL=index.cjs.map
|
|
5588
5529
|
//# sourceMappingURL=index.cjs.map
|