How to use the bazinga64.Decoder.fromBase64 function in bazinga64

To help you get started, we’ve selected a few bazinga64 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wireapp / wire-webapp / src / script / util / util.ts View on Github external
export const base64ToArraySync = (base64: string): Uint8Array => Decoder.fromBase64(stripDataUri(base64)).asBytes;
github wireapp / wire-web-packages / packages / core / src / main / cryptography / CryptographyService.ts View on Github external
public decrypt(sessionId: string, encodedCiphertext: string): Promise {
    this.logger.log(`Decrypting message for session ID "${sessionId}"`);
    const messageBytes: Uint8Array = Decoder.fromBase64(encodedCiphertext).asBytes;
    return this.cryptobox.decrypt(sessionId, messageBytes.buffer);
  }
github wireapp / wire-web-packages / packages / cryptobox / src / main / store / CryptoboxCRUDStore.ts View on Github external
private from_store(record: PersistedRecord): ArrayBuffer {
    return typeof record.serialised === 'string'
      ? Decoder.fromBase64(record.serialised).asBytes.buffer
      : record.serialised;
  }
github wireapp / wire-web-packages / packages / core / src / main / cryptography / CryptographyService.ts View on Github external
private async encryptPayloadForSession(
    sessionId: string,
    plainText: Uint8Array,
    base64EncodedPreKey: string,
  ): Promise {
    this.logger.log(`Encrypting Payload for session ID "${sessionId}"`);
    let encryptedPayload;

    try {
      const decodedPreKeyBundle: Uint8Array = Decoder.fromBase64(base64EncodedPreKey).asBytes;
      const payloadAsBuffer: ArrayBuffer = await this.cryptobox.encrypt(
        sessionId,
        plainText,
        decodedPreKeyBundle.buffer,
      );
      encryptedPayload = Encoder.toBase64(payloadAsBuffer).asString;
    } catch (error) {
      this.logger.error(`Could not encrypt payload: ${error.message}`);
      encryptedPayload = '💣';
    }

    return {sessionId, encryptedPayload};
  }
github wireapp / wire-web-packages / packages / cryptobox / src / main / store / CryptoboxCRUDStore.ts View on Github external
private from_store(record: PersistedRecord): ArrayBuffer {
    return typeof record.serialised === 'string'
      ? Decoder.fromBase64(record.serialised).asBytes.buffer
      : record.serialised;
  }
github wireapp / wire-web-packages / packages / cryptobox / src / main / store / IndexedDB.ts View on Github external
return records.map((record: SerialisedRecord) => {
          const payload =
            typeof record.serialised === 'string'
              ? Decoder.fromBase64(record.serialised).asBytes.buffer
              : record.serialised;
          return ProteusKeys.PreKey.deserialise(payload);
        });
      });

bazinga64

Base64 encoding and decoding with ASCII string representation.

GPL-3.0
Latest version published 11 days ago

Package Health Score

63 / 100
Full package analysis