Skip to content

Commit

Permalink
access modfiers
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitpubnub committed Sep 25, 2023
1 parent 9d43d8d commit 3e1d47f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/crypto/modules/NodeCryptoModule/nodeCryptoModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export default class CryptoModule {
return new this({ default: defaultCryptor });
}

getAllCryptors() {
private getAllCryptors() {
return [this.defaultCryptor, ...this.cryptors];
}

getLegacyCryptor() {
private getLegacyCryptor() {
return this.getAllCryptors().find((c) => c.identifier === '');
}

Expand Down Expand Up @@ -154,7 +154,7 @@ export default class CryptoModule {
}
}

async onStreamReadable(stream: NodeJS.ReadableStream, file: PubnubFile, File: PubnubFile) {
private async onStreamReadable(stream: NodeJS.ReadableStream, file: PubnubFile, File: PubnubFile) {
stream.removeAllListeners('readable');

const magicBytes = stream.read(4);
Expand All @@ -175,7 +175,7 @@ export default class CryptoModule {
});
}

async decryptLegacyFileStream(stream: NodeJS.ReadableStream, file: PubnubFile, File: PubnubFile) {
private async decryptLegacyFileStream(stream: NodeJS.ReadableStream, file: PubnubFile, File: PubnubFile) {
const cryptor = this.getLegacyCryptor();
if (cryptor) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand All @@ -192,7 +192,7 @@ export default class CryptoModule {
}
}

getCryptor(header: CryptorHeader) {
private getCryptor(header: CryptorHeader) {
if (header === '') {
const cryptor = this.getAllCryptors().find((c) => c.identifier === '');
if (cryptor) return cryptor;
Expand All @@ -202,7 +202,7 @@ export default class CryptoModule {
}
}

getCryptorFromId(id: string) {
private getCryptorFromId(id: string) {
const cryptor = this.getAllCryptors().find((c) => id === c.identifier);
if (cryptor) {
return cryptor;
Expand Down
8 changes: 4 additions & 4 deletions src/crypto/modules/WebCryptoModule/webCryptoModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class CryptoModule {
return new this({ default: defaultCryptor });
}

getAllCryptors() {
private getAllCryptors() {
return [this.defaultCryptor, ...this.cryptors];
}

Expand Down Expand Up @@ -122,7 +122,7 @@ export default class CryptoModule {
}
}

getCryptor(header: string | CryptorHeaderV1) {
private getCryptor(header: string | CryptorHeaderV1) {
if (header === '') {
const cryptor = this.getAllCryptors().find((c) => c.identifier === '');
if (cryptor) return cryptor;
Expand All @@ -132,15 +132,15 @@ export default class CryptoModule {
}
}

getCryptorFromId(id: string) {
private getCryptorFromId(id: string) {
const cryptor = this.getAllCryptors().find((c) => id === c.identifier);
if (cryptor) {
return cryptor;
}
throw Error('unknown cryptor');
}

concatArrayBuffer(ab1: ArrayBuffer, ab2: ArrayBuffer) {
private concatArrayBuffer(ab1: ArrayBuffer, ab2: ArrayBuffer) {
const tmp = new Uint8Array(ab1.byteLength + ab2.byteLength);

tmp.set(new Uint8Array(ab1), 0);
Expand Down

0 comments on commit 3e1d47f

Please sign in to comment.