Pointy Castle package
- Add
pointycastle
andhex
packages topubspec.yaml
file:
dependencies:
hex: ^0.2.0
pointycastle: ^3.6.0
- Install packages from the command line:
pub get
- Generate MD5 hash:
import 'dart:convert';
import 'dart:typed_data';
import "package:hex/hex.dart";
import 'package:pointycastle/pointycastle.dart';
void main() {
String text = 'Hello';
var digestObject = Digest('MD5');
var bytes = digestObject.process(utf8.encode(text) as Uint8List);
String digest = HEX.encode(bytes);
print(digest);
}
Leave a Comment
Cancel reply