argon.js 510 B

123456789101112131415161718
  1. 'use strict';
  2. const argon2 = require('argon2');
  3. const ARGON2_OPTIONS = {
  4. type: argon2.argon2id, // 推荐类型,不可改
  5. // eslint-disable-next-line no-bitwise
  6. memoryCost: 1 << 15, // 32768 KB = 32 MB(保守核心)
  7. timeCost: 3, // 迭代3轮,补足安全
  8. parallelism: 4, // 8vCPU 保守并行度
  9. hashLength: 32, // 哈希结果长度32字节
  10. raw: false, // 返回带参数/盐的字符串格式(默认false,无需改)
  11. };
  12. module.exports = {
  13. ARGON2_OPTIONS,
  14. };