How to Hash Value in Flutter Using SHA256?
14,944
Import (Crypto) :
import 'package:crypto/crypto.dart';
Then add this code:
var bytes1 = utf8.encode("Almahery"); // data being hashed var digest1 = sha256.convert(bytes1); // Hashing Process print("Digest as bytes: ${digest1.bytes}"); // Print Bytes print("Digest as hex string: $digest1"); // Print After Hashing
Author by
Muhammad Ashraf
Updated on July 29, 2022Comments
-
Muhammad Ashraf almost 2 years
Hashing Value (String or Int OR etc...) in Flutter ## Heading ##
I have Value like "Almahery"
How to Hash in in SHA 256 ?
-
Asad S almost 4 yearsHere's a bonus:
var output = sha256.convert(utf8.encode(input)).toString()