add digest, http_test

This commit is contained in:
2020-02-09 23:30:28 +08:00
parent 1d732537be
commit 9f8a7ccc59
4 changed files with 38 additions and 0 deletions

12
digest/digest.dart Normal file
View File

@@ -0,0 +1,12 @@
import 'dart:convert';
import 'package:crypto/crypto.dart';
// https://pub.dev/packages/crypto
main() async {
var bytes = utf8.encode("Hello World!");
var digest = sha256.convert(bytes);
// print("Digest as bytes: ${digest.bytes}");
print("Digest as hex string: $digest");
}

5
digest/pubspec.yaml Normal file
View File

@@ -0,0 +1,5 @@
name:
digest
dependencies:
crypto: ^2.1.3