1

There are some solutions to generate same hash code in android & iOS using native programming language (Swift & Java or Kotlin).

How can I do the same using dart language in Flutter?

1 Answer 1

2

Check this package .

usage:

import 'package:crypto/crypto.dart';
import 'dart:convert'; // for the utf8.encode method

void main() {
  var bytes = utf8.encode("MyString"); // data being hashed

  var digest = sha256.convert(bytes);

  print("Digest as bytes: ${digest.bytes}");
  print("Digest as hex string: $digest");
}
Sign up to request clarification or add additional context in comments.

1 Comment

When I encode strings such as this character ( " ) to byte List, it gives me different represents between iOS and android: in android: [34]. in iOS: [226,128,156].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.