日付の取得とhash値の算出

日付の取得とhash値の算出

https://qiita.com/n0bisuke/items/dd28122d006c95c58f9c

  1. npm install date-utils でモジュールをインストール
  2. require('date-utils');でモジュール読み込み
  3. var dt = new Date();で日付を取得

https://qiita.com/kou_pg_0131/items/174aefd8f894fea4d11a

  1. var crypto = require(“crypto”); でモジュールを読み込み
  2. var dt = new Date();で日付を取得
  3. var hash = crypto.createHash(“md5”).update(dt + req.body.email).digest(“hex”);でハッシュ値を算出
const crypto = require('crypto');
// サポートされているハッシュアルゴリズムを確認
console.log(crypto.getHashes());
// `crypto.createHash('アルゴリズム名').update('文字列').digest('hex')`
crypto.createHash('md5').update(plainText).digest('hex') 
  • 日付の取得とhash値の算出.1622445141.txt.gz
  • 最終更新: 2021/05/31 07:12
  • by 133.11.144.10