fx28-node
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

fx28-node

MEAN Module Build Status npm version Node.js Version

Base64 without padding.

Installation

yarn add fx28-node

Run tests

yarn test

Usage

import:

import * as fx28 from 'fx28-node';
// or Node.js style: const fx28 = require('fx28-node');

API

encodeURIComponent and Base64 are used during encoding, an optional xor parameter can be applied to add obfuscation.

function encode(bytes: Buffer): string;
function decode(str: string): Buffer;

Example

const fx28 = require('fx28-node');
 
const bytes = Buffer.from('abcd', 'utf8');
console.log('original bytes: ', bytes);
 
const base64Encoded = bytes.toString('base64');
const fx28Encoded = fx28.encode(bytes);
console.log('base64 encoded: ', base64Encoded);
console.log('fx28 encoded: ', fx28Encoded);
 
console.log('base64 decoded: ', Buffer.from(base64Encoded, 'base64'));
console.log('fx28 decoded: ', fx28.decode(fx28Encoded));

Output:

original bytes:  <Buffer 61 62 63 64>
base64 encoded:  YWJjZA==
fx28 encoded:  YWJjZA
base64 decoded:  <Buffer 61 62 63 64>
fx28 decoded:  <Buffer 61 62 63 64>

Readme

Keywords

Package Sidebar

Install

npm i fx28-node

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

7.65 kB

Total Files

17

Last publish

Collaborators

  • mgenware