반응형
노드 10.11.0 버전을 사용중에 있습니다. 노드 내장 모듈 중에는 암호화를 할 수 있는 crypto 라는 모듈이 있습니다. 이 모듈을 사용하면 손쉽게 hash값을 얻거나 단방향, 양방향 암호를 할 수 있습니다.
const crypto = require('crypto');
console.log( `base64 : ${ crypto.createHash('sha512').update('marsland@hanmail.net').digest('base64') }` );
console.log( `hex : ${ crypto.createHash('sha512').update('marsland@hanmail.net').digest('hex') }` );
참고
반응형
'Programming > Node.js' 카테고리의 다른 글
[Handlebars.js] Template와 Helper 사용하기 (0) | 2019.07.06 |
---|---|
node.js dotenv 로 환경변수 관리하기 (0) | 2018.10.03 |
Node.js + Express + Handlebars 프로젝트 생성하기 (0) | 2018.08.17 |
Node.js 및 npm 설치 (0) | 2018.08.13 |
Node.js + Express 프로젝트 생성하기 (1) | 2018.08.10 |