How to use the js-base64.Base64.atob function in js-base64

To help you get started, we’ve selected a few js-base64 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 netlify / netlify-cms / packages / netlify-cms-backend-github / src / API.ts View on Github external
async fetchBlobContent({ sha, repoURL, parseText }: BlobArgs) {
    const result: GitHubBlob = await this.request(`${repoURL}/git/blobs/${sha}`);

    if (parseText) {
      // treat content as a utf-8 string
      const content = Base64.decode(result.content);
      return content;
    } else {
      // treat content as binary and convert to blob
      const content = Base64.atob(result.content);
      const byteArray = new Uint8Array(content.length);
      for (let i = 0; i < content.length; i++) {
        byteArray[i] = content.charCodeAt(i);
      }
      const blob = new Blob([byteArray]);
      return blob;
    }
  }
github expo / expo / apps / native-component-list / src / screens / Bluetooth / BluetoothPeripheralScreen.tsx View on Github external
const nativeToJSON = value => {
  const binary = Base64.atob(value);
  const modifiedBinaryString = binary
    .split('')
    .map(c => `%${('00' + c.charCodeAt(0).toString(16)).slice(-2)}`)
    .join('');
  return decodeURIComponent(modifiedBinaryString);
};
const Services = {};
github expo / expo / packages / expo-bluetooth-utils / build / Bluetooth.js View on Github external
export function decodeBinaryString(str) {
    const binary = Base64.atob(str);
    const modifiedBinaryString = binary
        .split('')
        .map(c => `%${('00' + c.charCodeAt(0).toString(16)).slice(-2)}`)
        .join('');
    return decodeURIComponent(modifiedBinaryString);
}
//# sourceMappingURL=Bluetooth.js.map
github expo / expo / packages / expo-bluetooth-utils / src / Bluetooth.ts View on Github external
export function decodeBinaryString(str: string): string {
  const binary = Base64.atob(str);
  const modifiedBinaryString = binary
    .split('')
    .map(c => `%${('00' + c.charCodeAt(0).toString(16)).slice(-2)}`)
    .join('');
  return decodeURIComponent(modifiedBinaryString);
}
github quicktype / quicktype / src / Support.ts View on Github external
export function inflateBase64(encoded: string): string {
    const bytes = Base64.atob(encoded);
    return pako.inflate(bytes, { to: "string" });
}
github ailabstw / pttai.js / src / reducers / ServerUtils.js View on Github external
export const b64decodeByte = (str) => {
  return Base64.atob(str)
}
github expo / expo / packages / expo-firebase-firestore / src / Blob.ts View on Github external
static fromBase64String(base64: string): Blob {
    invariant(
      base64 === 'string' && base64.length > 0,
      'firestore.Blob.fromBase64String expects a string of at least 1 character in length'
    );

    return new Blob(Base64.atob(base64));
  }