New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

deterministic-base64-json

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deterministic-base64-json

Deterministically convert an object to a Base64 string and back.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
2
-75%
Maintainers
1
Weekly downloads
 
Created
Source

deterministic-base64-json

Deterministically convert an object to a Base64 string and back.

Install

$ yarn add deterministic-base64-json

Usage

const {decode, encode} = require('deterministic-base64-json');

const text = encode({foo: 1, bar: 2});
// Encoded the same as `encode({bar: 2, foo: 1})`.
const value = decode(text);
// Equals `{bar: 2, foo: 1}`.

API

decode(text)

Returns the decoded value of text, or throws if it can't be decoded.

text

  • Type: string

A Base64 string, probably from encode.

encode(value)

Returns the encoded text of value.

value

  • Type: any

A value to be encoded.

License

MIT © Matthew Fernando Garcia

FAQs

Package last updated on 13 May 2018

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