Socket
Socket
Sign inDemoInstall

@ethersproject/base64

Package Overview
Dependencies
1
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ethersproject/base64

Base64 coder.


Version published
Weekly downloads
837K
increased by8.56%
Maintainers
1
Created
Weekly downloads
 

Package description

What is @ethersproject/base64?

@ethersproject/base64 is a utility package from the ethers.js library that provides functions for encoding and decoding data in Base64 format. It is particularly useful in the context of Ethereum and blockchain development, where data often needs to be encoded or decoded for various purposes such as data storage, transmission, and smart contract interactions.

What are @ethersproject/base64's main functionalities?

Base64 Encoding

This feature allows you to encode a string into Base64 format. The `encode` function takes a string as input and returns its Base64 encoded representation.

const { encode } = require('@ethersproject/base64');
const data = 'Hello, world!';
const encodedData = encode(data);
console.log(encodedData);

Base64 Decoding

This feature allows you to decode a Base64 encoded string back to its original format. The `decode` function takes a Base64 encoded string as input and returns the decoded string.

const { decode } = require('@ethersproject/base64');
const encodedData = 'SGVsbG8sIHdvcmxkIQ==';
const decodedData = decode(encodedData);
console.log(decodedData);

Other packages similar to @ethersproject/base64

Readme

Source

Base64 Coder

function decode(textData: string): Uint8Array

Decodes a base64 encoded string into the binary data.

import * as base64 from "@ethersproject/base64";

let encodedData = "...";
let data = base64.decode(encodedData);
console.log(data);
// { Uint8Array: [] }

function encode(data: Arrayish): string

Decodes a base64 encoded string into the binary data.

import * as base64 from "@ethersproject/base64";

let data = [ ];
let encodedData = base64.encode(data);
console.log(encodedData);
// "..."

License

MIT License

Keywords

FAQs

Last updated on 24 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc