1.5.3 • Published 3 years ago

pass.code.js v1.5.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

pass.code.js

npm npm npm

This is a WORD to PASSCODE library

Table of Contents

Installation

NPM: npm install pass.code.js YARN: yarn add pass.code.js

Changelog

CHANGELOG

API

click the function name to see the usage

Usage

ASCII and UTF-8

wordToASCII

Start with JavaScript

const { wordToASCII } = require("pass.code.js");
const ascii = wordToASCII("Hello World!");
console.log(ascii) // output: 'Hello World!' in ascii
/* output:
[
   72, 101, 108, 108, 111,
   32,  87, 111, 114, 108,
  100,  33
]
*/

To typescript, Example:

import { wordToASCII, ASCII } from "pass.code.js";
const ascii: ASCII = wordToASCII("Hello World!");
console.log(ascii) // output: 'Hello World!' in ascii
/* output:
[
   72, 101, 108, 108, 111,
   32,  87, 111, 114, 108,
  100,  33
]
*/

ASCIItoWord

const { ASCIItoWord } = require("pass.code.js");
const word = ASCIItoWord([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]);
console.log(word) // output: 'Hello World!'

/// or typescript
import { ASCIItoWord } from "pass.code.js";
const word: string = ASCIItoWord([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]);
console.log(word) // output: 'Hello World!'

BUFFER and HEX

bufferToHex

const { bufferToHex } = require("pass.code.js");
const hex = bufferToHex(Buffer.from("Hello World!"));
console.log(hex) // output: '48656c6c6f20576f726c6421'

/// typescript
import { bufferToHex } from "pass.code.js";
const hex: string = bufferToHex(Buffer.from("Hello World!"));
console.log(hex) // output: '48656c6c6f20576f726c6421'

UTF-8 and HEX

WordToHex

const { WordToHex } = require("pass.code.js");
const hex = WordToHex("Hello World!");
console.log(hex) // output: '48656c6c6f20576f726c6421'

/// typescript
import { WordToHex, Hex } from "pass.code.js";
const hex: Hex = WordToHex("Hello World!");
console.log(hex) // output: '48656c6c6f20576f726c6421'

HexToWord

const { HexToWord } = require("pass.code.js");
const word = HexToWord("48656c6c6f20576f726c6421");

console.log(word) // output: 'Hello World!'

/// typescript
import { HexToWord } from "pass.code.js";
const word: string = HexToWord("48656c6c6f20576f726c6421");
console.log(word) // output: 'Hello World!'

UUID v4

generateUUID

const { generateUUID } = require("pass.code.js");
const uuid = generateUUID();
console.log(uuid) // output: '6b8b8b8b-8b8b-8b8b-8b8b-8b8b8b8b8b8b'

/// typescript
import { generateUUID } from "pass.code.js";
const uuid: string = generateUUID();
console.log(uuid) // output: '6b8b8b8b-8b8b-8b8b-8b8b-8b8b8b8b8b8b'

License

Pass.code.js is available under the MIT license. Pass.code.js also includes external libraries that are available under a variety of licenses. See LICENSE for the full license text.

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.2.0

3 years ago

1.3.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago