Created
October 8, 2023 14:21
-
-
Save rafaelqueiroz88/c5b6adfdb4bd9b23778bdffc09a4ecfc to your computer and use it in GitHub Desktop.
Encrypting locally password before request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
// package needed: https://pub.dev/packages/crypto | |
import 'package:crypto/crypto.dart'; | |
void main() { | |
var passwordBytes = utf8.encode("s0me-super-cool-p@$$WorD-here"); | |
var passwordEncrypt = sha256.convert(passwordBytes); | |
print("Digest as bytes: ${passwordEncrypt.bytes}"); | |
print("Digest as bytes: ${passwordEncrypt}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment