From b1426b9a41b0989075a0f079d6b18a98ea32d9db Mon Sep 17 00:00:00 2001 From: "Hamed H." Date: Mon, 12 Aug 2024 17:39:54 -0400 Subject: [PATCH 1/2] Add Wasm support Since dart:html is not supported when compiling to Wasm, the correct alternative now is to use dart.library.js_interop to differentiate between native and web Source: https://dart.dev/interop/js-interop/package-web --- lib/src/sha512.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/sha512.dart b/lib/src/sha512.dart index 97f8444..3693c54 100644 --- a/lib/src/sha512.dart +++ b/lib/src/sha512.dart @@ -7,7 +7,7 @@ import 'dart:convert'; import 'digest.dart'; import 'hash.dart'; // ignore: uri_does_not_exist -import 'sha512_fastsinks.dart' if (dart.library.html) 'sha512_slowsinks.dart'; +import 'sha512_fastsinks.dart' if (dart.library.js_interop) 'sha512_slowsinks.dart'; import 'utils.dart'; /// An implementation of the [SHA-384][rfc] hash function. From eb5669753ccbd6d11900a939d6c5d5d7a34238f9 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Mon, 12 Aug 2024 16:58:29 -0700 Subject: [PATCH 2/2] fix formatting --- lib/src/sha512.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/sha512.dart b/lib/src/sha512.dart index 3693c54..467d524 100644 --- a/lib/src/sha512.dart +++ b/lib/src/sha512.dart @@ -7,7 +7,8 @@ import 'dart:convert'; import 'digest.dart'; import 'hash.dart'; // ignore: uri_does_not_exist -import 'sha512_fastsinks.dart' if (dart.library.js_interop) 'sha512_slowsinks.dart'; +import 'sha512_fastsinks.dart' + if (dart.library.js_interop) 'sha512_slowsinks.dart'; import 'utils.dart'; /// An implementation of the [SHA-384][rfc] hash function.