Skip to content

Commit

Permalink
remove: Remove kIsWasm
Browse files Browse the repository at this point in the history
  • Loading branch information
koji-1009 committed Dec 5, 2024
1 parent 9d36a73 commit 2d3497d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/src/crypto_subtle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ library common;
import 'dart:js_interop';
import 'dart:typed_data';

import 'package:flutter/foundation.dart' show kIsWasm;
import 'package:meta/meta.dart';

import 'jsonwebkey.dart' show JsonWebKey, RsaOtherPrimesInfo;
Expand Down Expand Up @@ -339,37 +338,37 @@ TypedData getRandomValues(TypedData array) {
if (array is Uint8List) {
final values = array.toJS;
window.crypto.getRandomValues(values);
if (kIsWasm) {
if (array != values.toDart) {
array.setAll(0, values.toDart);
}
} else if (array is Uint16List) {
final values = array.toJS;
window.crypto.getRandomValues(values);
if (kIsWasm) {
if (array != values.toDart) {
array.setAll(0, values.toDart);
}
} else if (array is Uint32List) {
final values = array.toJS;
window.crypto.getRandomValues(values);
if (kIsWasm) {
if (array != values.toDart) {
array.setAll(0, values.toDart);
}
} else if (array is Int8List) {
final values = array.toJS;
window.crypto.getRandomValues(values);
if (kIsWasm) {
if (array != values.toDart) {
array.setAll(0, values.toDart);
}
} else if (array is Int16List) {
final values = array.toJS;
window.crypto.getRandomValues(values);
if (kIsWasm) {
if (array != values.toDart) {
array.setAll(0, values.toDart);
}
} else if (array is Int32List) {
final values = array.toJS;
window.crypto.getRandomValues(values);
if (kIsWasm) {
if (array != values.toDart) {
array.setAll(0, values.toDart);
}
} else {
Expand Down

0 comments on commit 2d3497d

Please sign in to comment.