jsencoder
v1.0.1
Published
encode and decode of string
Downloads
4
Readme
#JSENCODER
Encode e decode String
Importação da Biblioteca jsencoder
Importe via CDN ou NPM
npm i jsencoder
<script src="https://cdn.jsdelivr.net/npm/[email protected]/index.js"></script>
teste Codigo HTML index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JS Encode Example</title>
<!-- Inclua o arquivo jsencode.js aqui via CDN ou localmente -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/index.js"></script>
</head>
<body>
<script>
var text = 'hello-word';
var x1 = jsencoder.encode(text);
var x2 = jsencoder.decode(x1);
console.log(x1);
console.log(x2);
console.log('-----------------------------------');
//encode and decode of using key
var xx1 = jsencoder.encodeKey('test', text);
var xx2 = jsencoder.decodeKey('test', xx1);
console.log(xx1);
console.log(xx2);
</script>
</body>
</html>
JavaScript NodeJS app.js
const jsencoder = require('./jsencoder');
var text = 'hello-word';
var x1 = jsencoder.encode(text);
var x2 = jsencoder.decode(x1);
console.log(x1);
console.log(x2);
console.log('------------------------------')
var xx1 = jsencoder.encodeKey('test', text);
var xx2 = jsencoder.decodeKey('test', xx1);
console.log(xx1);
console.log(xx2);
Nosso Site jsaplication.com.br