hashWithSha256 method

String hashWithSha256({
  1. required String secret,
})

Implementation

String hashWithSha256({required String secret,}) {
int timeStamp = DateTime.now().millisecondsSinceEpoch ~/ 10000;
String _secret = "$timeStamp$secret";
List<int> bytes = utf8.encode(_secret);
String hash = sha256.convert(bytes).toString();
return hash;
  }