npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

turing-crypt

v1.0.3

Published

>O projeto open-source Turing é um canivete suíço quando o assunto é segurança e integridade dos dados a serem trafegados em aplicações em produção de projetos Node.js

Downloads

5

Readme

turing-crypt

O projeto open-source Turing é um canivete suíço quando o assunto é segurança e integridade dos dados a serem trafegados em aplicações em produção de projetos Node.js

OBS: A biblioteca Turing sofre com atualizações diárias devido ao versionamento atual, pois a lib encontra-se em estado BETA atualmente, a versão atual também não tem suporte à TypeScript mas terá nas próximas releases.

Instalação

Primeiro, para adicionar o Turing em seu projeto Node.js, comece instalando o pacote com o seguinte comando:

npm install turing-crypt

ou você pode usar o Yarn (recomendado) se preferir:

yarn add turing-crypt`

Documentação

Com o Turing já adicionado ao projeto, vamos partir para a documentação, mas antes de embarcar nesse foguete, veja quais são os passageiros e suas funções nesse foguete:

| Passageiros | Funções | |--------------------|--------------------------------------------------------------------| | JWTEncode | Criptografa um playload para ser usado em comunicações server-side | | JWTDecode | Gera um buffer com x bytes e retorna em Base64 | | RandomBytesHex | Gera um buffer com y bytes e retorna em Hexadecimal | | AESEncrypt | Criptografa dados usando AES-256 | | AESDecrypt | Descriptografa mensagem/dado criptografados com AES-256 | | MD5 | Criptografa dado usando hash MD5 (não recomendado) | | SHA1 | Criptografa dados usando hash SHA1 | | SHA256 | Criptografa dados usando hash SHA256 | | SHA384 | Criptografa dados usando hash SHA384 | | SHA512 | Criptografa dados usando hash SHA512 |

Mais funções vão ser adicionadas em futuras releases.

Depois de já ter conhecido os passageiros, agora é hora de levar esse foguete à lua.

JWT

JWTEncode


const turing = require('turing-crypt');

let payload = { // Exemplo de payload
	id: 1,
	email: '[email protected]',
	pass: 'test'
};
const secret = 1234;
let jwt = turing.JWTEncode(payload,secret);

console.log(jwt);

JWTDecode


const turing = require('turing-crypt');

let encoded = ''; // JWT Codificado
const secret = 1234; // Senha
let payload = turing.JWTDecode(encded,secret);

console.log(jwt);

RandomBytes

RandomBytesBase64


const turing = require('turing-crypt');

let bytes = 32;
let random = turing.RandomBytesBase64(bytes);

console.log(random);

RandomBytesHex


const turing = require('turing-crypt');

let bytes = 32;
let random = turing.RandomBytesHex(bytes);

console.log(random);

MD5


const turing = require('turing-crypt');

let data = 'essa é minha senha';
let hash = turing.MD5(data);

console.log(hash);

SHA

SHA1


const turing = require('turing-crypt');

let data = 'essa é minha senha';
let hash = turing.SHA1(data);

console.log(hash);

SHA256


const turing = require('turing-crypt');

let data = 'essa é minha senha';
let hash = turing.SHA256(data);

console.log(hash);

SHA384


const turing = require('turing-crypt');

let data = 'essa é minha senha';
let hash = turing.SHA384(data);

console.log(hash);

SHA512


const turing = require('turing-crypt');

let data = 'essa é minha senha';
let hash = turing.SHA512(data);

console.log(hash);

AES

AESEncrypt


const turing = require('turing-crypt');

let data = 'O imperador romano Júlio Cesar atacará hoje ao anoitecer';
const password = 123456789;
let encrypt = turing.AESEncrypt(data,passoword);

console.log(encrypt);

AESDecrypt


const turing = require('turing-crypt');

let data = '626c6120626c6120626c6120626c6120626c6120626c610a';
const password = 123456789;

let decrypt = turing.AESDecrypt(data,passoword);

console.log(decrypt)

Licença

Licença MIT Direitos autorais (c) 2020 Daniel Pereira

É concedida permissão, gratuitamente, a qualquer pessoa que obtenha uma cópia deste software e arquivos de documentação associados (o "Software"), para lidar no Software sem restrição, incluindo, sem limitação, os direitos usar, copiar, modificar, mesclar, publicar, distribuir, sublicenciar e / ou vender cópias do Software e permitir pessoas a quem o Software está mobilado para fazê-lo, sujeito às seguintes condições:

O aviso de direitos autorais acima e este aviso de permissão devem ser incluídos em todos cópias ou partes substanciais do Software.

O SOFTWARE É FORNECIDO "TAL COMO ESTÁ", SEM GARANTIA DE QUALQUER TIPO, EXPRESSA OU IMPLÍCITA, INCLUINDO MAS NÃO SE LIMITANDO A GARANTIAS DE COMERCIALIZAÇÃO, APTIDÃO PARA UM OBJETIVO ESPECÍFICO E NÃO INFRACÇÃO. EM NENHUM CASO A AUTORES OU TITULARES DE DIREITOS AUTORAIS SÃO RESPONSÁVEIS POR QUALQUER REIVINDICAÇÃO, DANOS OU OUTROS RESPONSABILIDADE, SEJA EM AÇÃO DE CONTRATO, TORT OU DE OUTRA FORMA, DECORRENTE DE, FORA OU EM CONEXÃO COM O SOFTWARE OU O USO OU OUTROS NEGÓCIOS NO PROGRAMAS.