index.dart 312 B

1234567891011121314
  1. import 'dart:convert';
  2. import 'package:convert/convert.dart';
  3. class Encrypt {
  4. static String passwordToEncryptKey(String password) {
  5. String passHex = hex.encode(utf8.encode(password));
  6. if (passHex.length > 32) {
  7. return passHex.substring(0, 32);
  8. }
  9. return passHex.padRight(32, '0');
  10. }
  11. }